As pointed out in the comments by @gIS, the form of the desired unitary transformation follows from the Schmidt decomposition of the two states. To see this, write down the Schmidt decomposition of $|\psi'\rangle$ and $|\psi''\rangle$
$$
\begin{align}
|\psi'\rangle = \sum_i\lambda_i|i'_A\rangle|i'_B\rangle \\
|\psi''\rangle = \sum_i\lambda_i|i''_A\rangle|i''_B\rangle
\end{align}\tag1
$$
where $|i'_A\rangle$ and $|i''_A\rangle$ are orthonormal bases for qubit $A$, $|i'_B\rangle$ and $|i''_B\rangle$ are orthonormal bases for qubit $B$ and we use the fact that $|\psi'\rangle \sim |\psi''\rangle$ to justify denoting their shared Schmidt coefficient as $\lambda_i$. The above equations make it clear that we can transform $|\psi'\rangle$ to $|\psi''\rangle$ by mapping $|i'_A\rangle \to |i''_A\rangle$ and $|i'_B\rangle \to |i''_B\rangle$. In other words, if
$$
\begin{align}
U_A = \sum_i|i''_A\rangle\langle i'_A| \\
U_B = \sum_i|i''_B\rangle\langle i'_B|
\end{align}\tag2
$$
then
$$
|\psi''\rangle = (U_A\otimes U_B)|\psi'\rangle.\tag3
$$
and we see that $(2)$ exhibits the desired unitary transformations.
In the specific case of
$$
|\psi'\rangle = \cos\frac{\gamma}{2}|00\rangle + \sin\frac{\gamma}{2}|11\rangle \\
|\psi''\rangle = \frac{1}{\sqrt{2}}\left[|00\rangle + |1\rangle(\cos\gamma|0\rangle + \sin\gamma|1\rangle)\right]\tag4
$$
we can immediately identify the bases $|i'_A\rangle$ and $|i'_B\rangle$ as the computational bases on $A$ and $B$ and the Schmidt coefficients as $\lambda_0=\cos\frac{\gamma}2$ and $\lambda_1=\sin\frac{\gamma}2$. In order to find $|i''_A\rangle$ and $|i''_B\rangle$ we solve the equation
$$
\frac{1}{\sqrt{2}}
\begin{bmatrix}1\\0\\ \cos\gamma\\ \sin\gamma\end{bmatrix} =
\cos\frac{\gamma}{2}\,
\begin{bmatrix}x_{00}\\ x_{01}\\ x_{10}\\ x_{11}\end{bmatrix} +
\sin\frac{\gamma}{2}\,
\begin{bmatrix}y_{00}\\ y_{01}\\ y_{10}\\ y_{11}\end{bmatrix}\tag5
$$
under the constraints that the unknown states are orthonormal product states. Recalling that $\sin^2\alpha+\cos^2\alpha=1$, $\cos2\alpha=\cos^2\alpha-\sin^2\alpha$ and $\sin2\alpha = 2\sin\alpha\cos\alpha$, we have
$$
\frac{1}{\sqrt{2}}
\begin{bmatrix}1\\0\\ \cos\gamma\\ \sin\gamma\end{bmatrix} =
\frac{1}{\sqrt{2}}\cos\frac{\gamma}{2}\,
\begin{bmatrix}\cos\frac{\gamma}{2}\\ \mp\sin\frac{\gamma}{2}\\ \cos\frac{\gamma}{2}\\ \sin\frac{\gamma}{2}\end{bmatrix} +
\frac{1}{\sqrt{2}}\sin\frac{\gamma}{2}\,
\begin{bmatrix}\sin\frac{\gamma}{2}\\ \pm\cos\frac{\gamma}{2} \\ -\sin\frac{\gamma}{2}\\ \cos\frac{\gamma}{2}\end{bmatrix}\tag6
$$
which becomes
$$
\frac{1}{\sqrt{2}}
\begin{bmatrix}1\\0\\ \cos\gamma\\ \sin\gamma\end{bmatrix} =
\frac{1}{\sqrt{2}}\cos\frac{\gamma}{2}\,
\begin{bmatrix}\cos\frac{\gamma}{2}\\ \sin\frac{\gamma}{2}\\ \cos\frac{\gamma}{2}\\ \sin\frac{\gamma}{2}\end{bmatrix} +
\frac{1}{\sqrt{2}}\sin\frac{\gamma}{2}\,
\begin{bmatrix}\sin\frac{\gamma}{2}\\ -\cos\frac{\gamma}{2} \\ -\sin\frac{\gamma}{2}\\ \cos\frac{\gamma}{2}\end{bmatrix}\tag7
$$
when we account for the requirement that the two states on the right hand side be product states. Finally, we can rewrite the last equation as
$$
\frac{1}{\sqrt{2}}
\begin{bmatrix}1\\0\\ \cos\gamma\\ \sin\gamma\end{bmatrix} =
\frac{1}{\sqrt{2}}\cos\frac{\gamma}{2}\,
\begin{bmatrix}1\\1\end{bmatrix} \otimes
\begin{bmatrix}\cos\frac{\gamma}{2}\\ \sin\frac{\gamma}{2}\end{bmatrix} + \frac{1}{\sqrt{2}}\sin\frac{\gamma}{2}\,
\begin{bmatrix}1\\-1\end{bmatrix} \otimes
\begin{bmatrix}\sin\frac{\gamma}{2}\\ -\cos\frac{\gamma}{2}\end{bmatrix}.\tag8
$$
Thus, we find
$$
\begin{align}
|0''_A\rangle &= |+\rangle = H|0\rangle \\
|1''_A\rangle &= |-\rangle = H|1\rangle \\
|0''_B\rangle &= R_y(\gamma)|0\rangle \\
|1''_B\rangle &= -R_y(\gamma) |1\rangle
\end{align}\tag9
$$
which means that
$$
|\psi''\rangle = \left(H \otimes R_y(\gamma) Z\right)|\psi'\rangle.\tag{10}
$$