Answer
$$y= 2(1+e^{\frac{1}{2}x^{2}-x}).$$
Work Step by Step
By separation of variables, we have $$\frac{dy}{y-2}=(x-1)dx$$
Then by integration, we get $$\ln(y-2)=\frac{1}{2}x^{2}-x+c\Longrightarrow y=Ae^{\frac{1}{2}x^{2}-x}+2.$$
Now, since $y(2)=4$, then $A=2$. So the general solution is given by $$y= 2(1+e^{\frac{1}{2}x^{2}-x}).$$