From the wikipedia page about transformation $T$:
$$T : \mathbb{R}^n \to \mathbb{R}^m$$
$\vec{x}$ is a column vector with $n$ entries.
$$T(\vec{x}) = \textbf{A}\vec{x}$$
$\textbf{A}$ is the transformation matrix of $T$.
It is easy to determine the transformation matrix $\textbf{A}$ by transforming each of the vectors of the standard basis by $T$, then inserting the result into the columns of a matrix:
$$\mathbf{A} = \begin{bmatrix} T( \vec e_1 ) & T( \vec e_2 ) & \cdots & T( \vec e_n ) \end{bmatrix}$$
Example: $T(x) = 5x$ is a linear transformation.
Applying the above process (suppose that n = 2 in this case) reveals that:
$$T( \vec{x} ) = 5 \vec{x} = 5 \mathbf{I} \vec{x} = \begin{bmatrix} 5 && 0 \\ 0 && 5 \end{bmatrix} \vec{x}$$
The questions are:
- What is "each of the vectors of the standard basis".
- How does the last equation work (wondering why the matrix is 2x2, and what the $\textbf{I}$ is, etc.) $$T( \vec{x} ) = 5 \vec{x} = 5 \mathbf{I} \vec{x} = \begin{bmatrix} 5 && 0 \\ 0 && 5 \end{bmatrix} \vec{x}$$
- Are they always square matrices? Wondering the general strategy for constructing a transformation matrix.
The vectors of the standard basis are
In this case we are looking for $T : \mathbb{R}^2 \to \mathbb{R}^2$ and $\mathbf{I}$ is the identity matrix $\begin{bmatrix} 1 && 0 \\ 0 && 1 \end{bmatrix}$ of order $2$.
In general for $T : \mathbb{R}^n \to \mathbb{R}^m$ the dimension of the matrix which represents the linear transformation is n-by-m that is with $n$ columns and $m$ rows.
For the construction, with respect to a given basis, the general strategy is to determine the transformed vectors for the vectors of the given basis. That is, if we refer to the standard basis
$$\mathbf{A} = \begin{bmatrix} T( \vec e_1 ) & T( \vec e_2 ) & \cdots & T( \vec e_n ) \end{bmatrix}$$
Note that more in general we could also choose different basis, and not necessarly the standard one among them, for $\vec x\in\mathbb{R}^n$ and $T[\vec x]\in\mathbb{R}^m$.