To be honest I think it's BS to teach separable variables like this without the Riemann-Stieljes integral.
The way I solve them is by doing what actually is done: integrate with respect to $x$ on both sides.
Remember that $y$ is a function (on the variable $x$). So your differential equation is, for all $x$ in a certain interval, $y'(x)=\dfrac{y(x)}{x}$ or equivalently $\dfrac{y'(x)}{y(x)}=\dfrac {1}{x}$and integrating with respect to $x$ you get the desired result.
In my opinion integrating with respect to $y$ is nothing more than a cheap trick, the same way $\dfrac{dy}{dx}=1\iff dy=dx$ is a cheap trick. It works only because of some higher math.
More generally, if you can rewrite your DE as $g(y(x))y'(x)=f(x)$ for some functions $f$ and $g$ that have antiderivatives, $F$ and $G$, in the given interval, then $g(y(x))y'(x)=f(x)\iff G(y(x))=F(x)+C$, for some $C\in \Bbb R$. (To establish $\Longleftarrow$ just differentiate). And if we're lucky enough for $G$ to be invertible, we get $y(x)=G^{-1}\left(F(x)+C\right)$. If $G$ isn't invertible, then hopefully the implicit function theorem will yield the solutions to the DE implicitly by the equation $G(y(x))=F(x)+C$.
In your example $g$ is the function $t\mapsto \dfrac{1}{t}$ which has $t\to \log (|t|)$ as an antiderivative. (Don't forget the absolute value).