Let $T: V \rightarrow V$ be a linear transformation, where $V$ is some $n$-dimensional space. Let $A, B$ be two ordered bases for $V$. Let $T_A$ and $T_B$ represent the matrix representations of $T$ with respect to $A$ and $B$ respectively. Let $x_A$ and $x_B$ denote the representations of an arbitrary vector $x \in V$ with respect to $A$ and $B$ respectively. Let $M$ be the change-of-basis matrix such that $x_A = Mx_B$.
By definition, we have $T(x_A) = T_Ax_A$ and $T(x_B) = T_Bx_B$.
Consider this proof that $T_B = M^{-1}T_AM:$
We have, $$\begin{aligned} T_Bx_B &= (T(x_A))_B \\&= (T_Ax_A)_B \\&= M^{-1}T_Ax_A \\&= M^{-1}T_AMx_B\end{aligned}$$
and hence, $$\begin{aligned} T_B = M^{-1}T_AM \end{aligned}$$
Is this proof correct? I'm having trouble understanding the first step: why is $T_Bx_B = (T(x_A))_B$? Also, in the third step, we implicitly assume $(T_Ax_A)_A = T_Ax_A$. Why is this true?
I suggest to proceed as follows, we have that $y_A=T_Ax_A $, $y_B=T_Bx_B $ and since $y_A=My_B \iff y_B=M^{-1}y_A$ we have
$$y_B=T_Bx_B $$
$$M^{-1}y_A=T_BM^{-1}x_A $$
$$y_A=MT_BM^{-1}x_A $$
that is
$$\boxed{T_A=MT_BM^{-1}\iff T_B = M^{-1}T_AM }$$