Show that the group $G$ is of order $12$ I am studying some exercises about semi-direct product and facing this solved one:

Show that the order of group $G=\langle a,b| a^6=1,a^3=b^2,aba=b\rangle$ is $12$.

Our aim is to show that $|G|\leq 12$ and then $G=\mathbb Z_3 \rtimes\mathbb Z_4=\langle x\rangle\rtimes\langle y\rangle$. So we need a homomorphism from $\mathbb Z_4$ to $\mathrm{Aut}(\mathbb Z_3)\cong\mathbb Z_2=\langle t\rangle$ to construct the semi-direct product as we wish: $$\phi:=\begin{cases} 1\longrightarrow \mathrm{id},& \\\\y^2\longrightarrow \mathrm{id},& \\\\y\longrightarrow t,& \\\\y^3\longrightarrow t, \end{cases}
$$ Here, I do know how to construct $\mathbb Z_3 \rtimes_{\phi}\mathbb Z_4$ by using $\phi$ and according to the definition. My question starts from this point:
The solution suddenly goes another way instead of doing $(a,b)(a',b')=(a\phi_b(a'),bb')$. It takes $$\alpha=(x,y^2), \beta=(1,y)$$ and note that these elements satisfy the relations in group $G$. All is right and understandable but how could I find such these later element $\alpha, \beta$?? Is really the formal way for this kind problems finding some generators like $\alpha, \beta$? Thanks for your help.

The subgroup $A$ generated by $a^2$ is normal and order 3. The subgroup $B$ generated by $b$ is of order 4. The intersection of these is trivial so the product $AB$ has order 12. So $G$ has order at least 12. To show it has order 12, we need to see that $a\in AB$; but $b^2=a^3=a^2a$ so $$a=a^{-2}b^2\in AB.$$ Thus the group is the semidirect product of $A$ by $B$ where $$ba^2b^{-1}=(ba)(ab^{-1})=a^{-1}(ba)b^{-1}=a^{-1}(a^{-1}b)b^{-1}=a^{-2}$$
