First, some easy observations: $T$ must be injective since for any $A$, there is some $B$ such that $B$ and $A+B$ have different determinants (easy exercise). By multiplying $T$ by $T(1)^{-1}$, it may be assumed that $T(1)=1$. Now note that $T$ preserves the rank of matrices. Indeed, $T$ must preserve the rank $n$ matrices, and then the rank $n-1$ matrices are just the nonsingular locus in the variety of matrices with determinant $0$. This implies $T$ preserves rank $n-1$ matrices. Rank $n-2$ matrices are then the nonsingular locus in rank $<n-1$ matrices so they are preserved, and so on. Now rank $k$ projections are exactly those rank $k$ matrices which when subtracted from the identity give you something of rank $n-k$; this is easy to see from Jordan normal form. Thus $T$ sends rank $1$ projections to rank $1$ projections. Two projections have disjoint ranges and commute iff their sum is also a projection. In particular, for $P_i$ the projections onto a basis $e_i$, $T$ sends $P_i$ to projections $Q_i$ onto some other basis $f_i$. Now let $U$ be the change of basis matrix from the $e_i$ to the $f_i$. Conjugating $T$ by $U$ shows that we may assume $T$ fixes each $P_i$. That is, picking the standard basis, $T$ fixes all diagonal matrices. Now matrices whose only nonzero entries are either all in the first row or all in the first column are characterized by the fact that they are rank $1$ and they remain rank $1$ if their first diagonal entry changes. Similar statements hold for other rows and columns. It follows that $T(e_{ij})$ is a multiple of either $e_{ij}$ or $e_{ji}$ for all $j$ and $i$, where $e_{ij}$ is the matrix with $ij$ entry $1$ and all others $0$. By considering the ranks of matrices with only two nonzero entries, it is now easy to see that we must either always have $T(e_{ij})$ a multiple of $e_{ij}$ or always have $T(e_{ij})$ a multiple of $e_{ji}$. Composing $T$ with the transpose map we may assume we are in the first case. Now let $a_{ij}$ be the scalars such that $T(e_{ij})=a_{ij}e_{ij}$. We know that $a_{ii}=1$, and by considering permutation matrices, it is easy to see that we must have $a_{ij}a_{jk}=a_{ik}$. It follows that $T$ coincides with conjugation by the diagonal matrix with diagonal entries $a_{1i}$, and in particular $T$ has the form $T(A)=UAV$.