Say I'm working in the space of linear transformations from R^n to R^n and I've picked a basis so I can identify with any operator a component matrix in R^{n*n}. Transposing an operator swaps components (i,j) and (j,i). In this setting, the transpose operation is itself a linear map from R^{n*n} to R^{n*n}.

What does the transpose operator's component representation look like for, say, n=2 or n=3? Not what does it do when applied, but in what space does it live and what are its actual components?

How does one speak about applying this representation to a matrix? Say T is the transpose representation and I'm applying it to a matrix A to get TA=A^{T}. What is precise way to discuss this linear algebra operation in the context of the component representations of both tensors?

Big bonus points for the two lines of Mathematica or Sage to demonstrate the mechanics.