Background: what are these potentials?
To see that this is a four-vector we must first understand where it comes from. We have the Maxwell equations, where I will use $\dot X = \partial_w X = c^{-1} \partial_t X$ to write as,
$$\begin{align}
\nabla\cdot E &= 4\pi\rho&
\nabla\times E&= - \dot B\\
\nabla\cdot B &= 0
&\nabla\times B&= 4\pi c^{-1} J + \dot E,
\end{align}$$
and after using $\nabla\cdot B = 0$ to define a family of $A$ via $B = \nabla\times A$ and the consequent $\nabla \times (E + \dot A) = 0$ to define a family of $\varphi$ via $E = -\dot A - \nabla \varphi,$ we can derive that
the remaining two equations state,$$
\begin{align}
-\nabla\cdot\dot A - \ddot\varphi &= 4\pi\rho\\
\nabla(\nabla\cdot A) - \nabla^2 A &= 4\pi c^{-1}J - \ddot A - \nabla\dot\varphi
\end{align}
$$ which can be handily rewritten (by defining $\Box X =\ddot X -\nabla^2 X,$ and $\lambda = \dot\varphi + \nabla\cdot A$) as,$$
\begin{align}
\Box\varphi &= 4\pi\rho + \dot \lambda,\\
\Box A &= 4\pi c^{-1}J - \nabla\lambda.
\end{align}$$
Now we could have chosen a different set of potentials and still obtained the same fields: we know that we can add any $\nabla\chi$ to $A$ and preserve $B=\nabla\times A$ because the curl of a gradient is zero; looking at what's needed to preserve $E$ tells us only that we should simultaneously subtract $\dot\chi$ from $\varphi$ to preserve $E$. This does not affect the form of the last two equations directly, but it does map the value of $\lambda\mapsto \lambda - \Box \chi,$ and so we can essentially choose a different functional form for $\lambda,$ on the grounds that if we want, say, $\lambda = \dot\varphi$ (Coulomb gauge) we can take any other solution $(A, \varphi)$ and calculate its $\lambda$ and then solve $\Box\chi = \lambda - \dot\varphi$ to find a $\chi$ which gives us a different set of fields which has this functional form.
Of course the Lorenz gauge that we now assume is to solve for $A,\varphi$ such that $\lambda=0,$ yielding,$$
\begin{align}
\Box\varphi &= 4\pi \rho\\
\Box A_x &= 4\pi c^{-1}J_x\\
\Box A_y &= 4\pi c^{-1}J_y\\
\Box A_z &= 4\pi c^{-1}J_z
\end{align}$$
I am going through all of this for three reasons:
- You claimed your equation was valid in CGS units and I think you are mistaken,
- To highlight that even when you find a solution it is not unique; other solutions $\Box\alpha = 0$ can be added to any component;
- To assert that there is a clear order here: one starts from knowing the charge and current densities and one then solves for these fields, which can be used to derive the $E$ and $B$ fields if one wishes.
Use the fact that $(\rho, J/c)$ is a four-vector.
The rough proof that $(\rho, J/c)$ is a four-vector involves imagining a static charge distribution first: a static charge distribution $(\rho_0, 0)$ becomes $(\gamma~\rho_0, -\gamma~ \rho_0 \vec \beta)$ under a Lorentz transform; this is easily seen to be a $(\rho, J/c)$ pair. But if this is a four-vector then a more complex arrangement is a four-vector, precisely because an arbitrary charge-current distribution can be arbitrarily-well approximated by a superposition of a bunch of little static charge-current distributions that have been boosted in various ways. If all of them individually transform appropriately over Lorentz transforms, then their sum must, too, because Lorentz transforms are linear.
If you agree with me that $(\rho, J/c)$ is a four-vector then this must also be the case for $(\varphi, A/c)$, also by a linearity argument, though it is a sufficiency and not a necessity (as it must be: the Lorenz gauge has not 100% nailed down the exact fields $\varphi$ and $A$, so there must be other fields that are not the Lorentz transform of these fields which also pass the Lorenz gauge and are valid).
Just examine the equations in the Lorenz gauge, after a Lorentz boost of the charge fields by $\beta$ in the $\hat z$ direction: $$\begin{align}
\Box\phi' &= 4\pi ~\gamma~(\rho - \beta c^{-1}J_z)\\
\Box A_x' &= 4\pi c^{-1}~J_x\\
\Box A_y' &= 4\pi c^{-1}~J_y\\
\Box A_z' &= 4\pi c^{-1}~\gamma~(J_z - \beta c\rho)
\end{align}$$It is clearly sufficient to solve these equations to find $A_x' = A_x$ and $A_y' = A_y.$ For $A_z'$ it is clearly sufficient to have $A_z' = \gamma~A_z - \gamma\beta\phi$ and for $\varphi' = \gamma~\varphi - \gamma\beta A_z.$
Thus: if you have solved $(\rho, J/c)$ for the fields $(\varphi, A)$ in the Lorenz gauge, then you can obtain a valid solution for the fields $(\varphi', A')$ that you would get from solving the same equations for the Lorentz-boosted $(\rho', J'/c)$ simply by Lorentz-transforming the fields $(\varphi, A)$ as a four-vector.
In other words: there are ways to do electromagnetism in which that pair is not a four-vector, but it does no harm to assume that it is.