**Hint** Notice that if $P$ is an invertible matrix then by the rank nullity theorem we see easily that $$rk(PA)=rk(A)\quad;\quad rk(AP)=rk(A)$$ moreover notice that the matrix of a linear transformation $T$ relative to a basis $X$ and $Y$ is $$P^{-1}AQ$$ where $A$ is the matrix of $T$ relative to the standard basis and $P$ and $Q$ are the change basis from the standard basis to the basis $X$ and $Y$ respectively. Can you take it from here?