The reason $\ln(x)$ is chosen is this:
(Note: where I say $B_{t}$ I mean Brownian motion, which you denoted in your question as $W_{t}$)
The SDE you provided is one of the few we can explicitly solve. I'll talk about Geometric Brownian Motion (GBM) $dX_{t} = \mu X_{t} \,dt + \sigma X_{t} \,dB_{t}$, but as you mentioned in your question, your case is the same when $\mu$ becomes a function of $t$.
You can "multiply" the stochastic differential equation (SDE) in its differential form by $\frac{1}{X_{t}}$ to get $$\frac{1}{X_{t}}dX_{t} = \frac{1}{X_{t}}\mu X_{t} \,dt + \frac{1}{X_{t}}\sigma X_{t} \,dB_{t} $$
and this simplifies to $$ \frac{1}{X_{t}}dX_{t} = \mu \,dt + \sigma \,dB_{t}.$$
Notice that the right hand side no longer depends on $X_{t}$. Now recall Ito's formula for a $C^{2,1}$ function $f(t,x)$ ($C^{2,1}$ means $f$ is twice differentiable in $x$ and once differentiable in $t$). Ito's formula tells us if $X_{t}$ satisfies the previous SDE, then $f(t,X_{t})$ will satisfy:
$$d(f(t,X_{t})) = \frac{\partial f}{\partial t}(t,X_{t}) \,dt + \frac{\partial f}{\partial x}(t,X{t}) \,dX_{t} + \frac{1}{2} \frac{\partial^{2} f}{\partial x^{2}}(t,X_{t}) \,d[X]_{t}$$
where $[X]_{t}$ is the quadratic variation process of $X_{t}$. Notice that in the SDE given to us by Ito's formula, one of the terms on the right hand size is $\frac{\partial f}{\partial x}(t,X{t}) \,dX_{t}$. This almost looks like our $\frac{1}{X_{t}} \,dX_{t}$, which was the left hand side of our original SDE. If we can choose $f(t,X_{t})$ wisely such that these are equal (i.e., such that $\frac{\partial f}{\partial x}(t,X{t})= \frac{1}{X_{t}}$, then we can solve this special SDE.
Hopefully you see that we should have $f(t,x) = \ln(x)$ for the above equality to hold. Okay, so since $f$ doesn't depend on $t$, let's call it $f(x)$ to save space. Substituting this $f$ into Ito's formula above gives:
$$d(\ln(X_{t})) = 0 \,dt + \frac{1}{X_{t}} \,dX_{t} - \frac{1}{2} \frac{1}{X_{t}^2} \,d[X]_{t}$$
Hmm... on the right hand side there is conveniently a $\frac{1}{X_{t}} \,dX_{t}$ (which was the whole point! That's why we choose $f$ as we did) and we have an SDE for this already. We have that $\frac{1}{X_{t}}dX_{t} = \mu \,dt + \sigma \,dB_{t}$.
Okay, so solving for $\frac{1}{X_{t}}\,dX_{t}$ in the Ito's formula SDE gives
$$\frac{1}{X_{t}} \,dX_{t} =d(\ln(X_{t})) + \frac{1}{2} \frac{1}{X_{t}^2} \,d[X]_{t} $$
and this allows us to set the right hand side of the above equal to $\mu \,dt + \sigma \,dB_{t}$. So we have $$d(\ln(X_{t})) + \frac{1}{2} \frac{1}{X_{t}^2} \,d[X]_{t} = \mu \,dt + \sigma \,dB_{t}. $$
What is $d[X]_{t}$? If you do the computation, you get $\sigma^{2} X_{t}^{2} \,dt$, so that our equation becomes $$d(\ln(X_{t})) + \frac{1}{2} \sigma^{2} \,dt = \mu \,dt + \sigma \,dB_{t}. $$
This simplifies to $$\ln(X_{t}) = \ln(X_{0}) + \int \limits_{0}^{t}(\mu - \frac{1}{2} \sigma^{2}) \,dt + \int \limits_{0}^{t}\sigma \,dB_{t} $$
so that $X_{t} = X_{0}e^{\int \limits_{0}^{t}(\mu - \frac{1}{2} \sigma^{2}) \,dt + \int \limits_{0}^{t}\sigma \,dB_{t}}$.
Best Answer
In order to solve the SDE
$$dX_t = \alpha X_t \, dt + \sqrt{2} \, dB_t \qquad X_0 = x \tag{1}$$
we consider the corresponding ordinary differential equation
$$dx(t) = \alpha x(t) \, dt, \qquad x(0)=c.$$
It is not difficult to see that its unique solution equals
$$x(t) = c \, e^{\alpha t}.$$
Now the idea is to use an analogue of the variation of constants-approach: We let the constant $c$ depend on the time $t$ and on $\omega$, i.e. we set
$$C_t(\omega) := X_t(\omega) \cdot e^{-\alpha t}. \tag{2}$$
Applying Itô's formula (to $f(t,x) := x e^{-\alpha t}$), we get
$$C_t - C_0 = \int_0^t e^{-\alpha s} \, dX_s - \alpha \int_0^t X_s e^{-\alpha s} \, ds \stackrel{(1)}{=} \sqrt{2} \int_0^t e^{-\alpha s} \, dB_s.$$
Hence, by $(2)$,
$$X_t = C_t e^{\alpha t} = e^{\alpha t} C_0 + \sqrt{2} \int_0^t e^{\alpha (t-s)} \, dB_s.$$
Finally, note that
$$C_0 = X_0 \cdot 1 = x.$$
Remarks