I'm surprised your textbook did not derive this equation from the reaction isotherm relationship between $\Delta G$ and the reaction quotient $Q$ and the Nernst equation. The derivation is not hard.
Reaction isotherm equation:
$$\Delta_\mathrm{r} G =\Delta_\mathrm{r} G^\circ + RT\ln Q$$
Nernst equation:
$$E_\mathrm{cell} = E^\circ_\mathrm{cell} - \frac{RT}{nF}\ln Q$$
If we solve both equations for $RT\ln Q$, we get your equation (almost).
\begin{align}
RT\ln Q
&= \Delta_\mathrm{r} G -\Delta_\mathrm{r} G^\circ\\
RT\ln Q
&= nFE^\circ_\mathrm{cell} - nFE_\mathrm{cell}\\
\Delta_\mathrm{r} G -\Delta_\mathrm{r} G^\circ
&= nFE^\circ_\mathrm{cell} - nFE_\mathrm{cell}
\end{align}
Why is my equation not as simple as the one you started with? Your equation is at equilibrium, and I assumed that we might not be at equilibrium. At equilibrium, the following are true, which simplify the relationship.
\begin{align}
Q &= K\\
\Delta_\mathrm{r} G &= 0\\
E_\mathrm{cell} &= 0
\end{align}
At equilibrium, $\Delta_\mathrm{r} G = 0$ because the reaction has achieved a minimum energy state — the chemical potential $\mu_i = \left(\frac{\partial G}{\partial N_i}\right)_{T,P}$ is also $0$ because there is no net change of state at equilibrium. Similarly $E_\mathrm{cell} = 0$ at equilibrium. There is no change of state, and thus the redox reaction has ground to a halt.
At equilibrium, the final relationship is
$$\Delta_RG^\circ = nFE^\circ_\mathrm{cell}$$