I started self-learning algebra and am proving isomorphisms. I think of one approach which I tried to formalize as follows:
Given group $G=\langle S\mid R\rangle$ where $S=\{a_1,\ldots, a_n\}$ and $R = \{r_i(1,a_1,\ldots,a_n)\}_{i=1}^m$. If we have another group $G'$ and function $\varphi:G\rightarrow G'$ such that $\varphi(1_G)=\varphi(1_{G'})$ and $r_i(1_{G'},\varphi(a_1),\ldots,\varphi(a_n))$ hold for $i=1,\ldots, m$, where the law of composition in $r_i$s are replaced by that of $G'$. Then $G\approx{\rm Im}(\varphi)$.
If this holds, then to prove $G\approx G'$ I only need to consider the map between their generators and check the relation of $G$ hold for $G'$ w.r.t. the corresponding generators. However, I cannot prove or disprove the statement above. I think the problem lies in how to formalize the group presentation and its properties.
Inspired by the comments: What if $\varphi$ is defined from $S\rightarrow G'$? Can we extend it to a homomorphism from $G\rightarrow G'$ given that $\varphi(a_1),\ldots,\varphi(a_n)$ follow the same rules in $R$? (This seems to be proved in Lee's answer in problem When can a homomorphism be determined entirely by its generators)