So a Lorentz boost (in this case in the $x$-direction by speed $v$) has the structure$$\gamma_v\begin{bmatrix}
1&-v/c&0&0\\
-v/c&1&0&0\\
0&0&1&0\\
0&0&0&1\end{bmatrix}.$$
Everyone agrees on 4-vectors in spacetime, though the components change by Lorentz transforms. One such 4-vector is the 4-velocity of the particle, which in $S$ is given by the column vector $\gamma_u\cdot[c,~u_x,~u_y,~u_z].$ This is a standard form for a 4-velocity and if you have not yet memorized it, you probably should, 4-velocities always look like $\gamma_v\cdot[c,\vec v]$ where $\vec v$ is their velocity in those coordinates; their 4-D magnitude according to the Minkowski metric is always $c.$
Now please abandon your hesitation and just do the transform; after transformation the 4-velocity must be $\gamma_{u'}\cdot[c, \vec u']$ so we can get $\gamma_{u'}$ from the very first component from the expression
$$\gamma_{u'}\begin{bmatrix}c\\u'_x\\u'_y\\u'_z\end{bmatrix} = \gamma_v\begin{bmatrix}
1&-v/c&0&0\\
-v/c&1&0&0\\
0&0&1&0\\
0&0&0&1\end{bmatrix} \cdot \gamma_u \begin{bmatrix}c\\u_x\\u_y\\u_z\end{bmatrix}.$$
So just do the transform and you will see that the very first component gives you the equation that you seek.