Both $P,Q$ are matrices from identity transformations, so $Q=[I_V]_\beta^{\beta'}$ and
\begin{align*}P^{-1}=([I_W]_\gamma^{\gamma'})^{-1}=[I_W^{-1}]_{\gamma'}^\gamma=[I_W]_{\gamma'}^\gamma\end{align*}
since the inverse of $I_W$ is itself. Now
\begin{align*}P^{-1}[T]_{\gamma}^{\beta} Q&=[I_W]_{\gamma'}^\gamma[T]_\gamma^\beta[I_V]_\beta^{\beta'}\\
&=[I_WT]_{\gamma'}^{\beta}[I_V]_\beta^{\beta'}\\
&=[T]_{\gamma'}^\beta[I_V]_\beta^{\beta'}\\
&=[TI_V]_{\gamma'}^{\beta'}\\
&=[T]_{\gamma'}^{\beta'}\end{align*}
since the definition of matrix multiplication means composition of (linear-)transformations.
In case you don't know why, here is bonus about matrix multiplication (But notice that the notation I used is different from your, for $T:V_\beta\to W_\gamma$ I written $[T]_\beta^\gamma$):
Let $T:\mathsf{V}\to\mathsf{W}$ a linear transformation and $\beta=\{v_1,v_2\}, \gamma=\{w_1,w_2\}$ are bases of $\mathsf{V}, \mathsf{W}$ respectively. The value of interest is
$$T(v).$$
Let $v=xv_1+yv_2$, then
$$\begin{align}
T(v)&=T(xv_1+yv_2)\\
&=xT(v_1)+yT(v_2).
\end{align}$$
No matter what value of $v$ is, $T(v_1),T(v_2)$ are needed, the notation can be simplified. Let
$$T(v_1)=aw_1+bw_2,\\
T(v_2)=cw_1+dw_2,$$
represent $T(v_1), T(v_2)$ in columns
$$
\begin{array}{ll}
T(v_1) & T(v_2)\\
aw_1 & cw_1\\
{+} & {+}\\
bw_2 & dw_2\\
\end{array}
$$
Put $w_1, w_2$ on the left side as a note and omit the plus signs
$$
\begin{array}{lll}
& T(v_1) & T(v_2) \\
w_1 & a & c \\
w_2 & b & d \\
\end{array}
$$
Since $T(v)=xT(v_1)+yT(v_2)$
$$
\begin{array}{}
& x & y \\
& T(v_1)\ \ \ +& T(v_2)\ \ = & T(v) \\
w_1 & a & c & e \\
w_2 & b & d & f \\
\end{array}
$$
An $\color{blue}{operation}$ can be defined such that
$$
e=\color{blue}{x}a+\color{blue}{y}c\\
f=\color{blue}{x}b+\color{blue}{y}d
$$
that is
$$
\begin{bmatrix}e\\f\end{bmatrix}
{=}
\begin{bmatrix}a & c\\b & d\end{bmatrix}
\color{blue}{oper.}
\begin{bmatrix}\color{blue}{x}\\\color{blue}{y}\end{bmatrix},
$$
The order $w_1, w_2$ are listed is associated to this notation, so the idea of ordered basis is required to denote the linear transformation matrix
$$\large[T]_\beta^\gamma$$
which here the lower-script $\beta$ means the matrix will work as a transformation when you multiply it with
$$\large[v]_\beta$$
the coordinate vector relative to $\beta$, and then you will get the output $w$ as coordinate vector relative to $\gamma$. We like this operation, so the $\color{blue}{operation}$ is defined s.t.
$$\large[T(v)]_\gamma = [T]_\beta^{\gamma} \color{blue}{\Large\cdot} [v]_\beta$$
Now open your book, find the definition of $\color{blue}{matrix\ multiplication}$ again and appreciate it.
--
Since for a linear transformation matrix $\large[U]_\alpha^\beta$, we can decompose it into column vectors from left to right, each as a coordinate vector, the composition of $\large[T]_{\beta}^{\gamma}$ and $\large[U]_{\alpha}^{\beta}$ now is
\begin{align*}
\large[T]_\beta^\gamma[U]_\alpha^\beta
&=\large[T]_\beta^\gamma[U(a_1)]_\beta \Bigg| [T]_\beta^\gamma[U(a_2)]_\beta\Bigg|\dots\Bigg|[T]_\beta^\gamma[U(a_n)]_\beta\\
&=\large[T(U(a_1))]_\gamma\Bigg|[T(U(a_2))]_\gamma\Bigg|\dots\Bigg|[T(U(a_n))]_\gamma\\
&=\large[TU(a_1)]_\gamma\Bigg|[TU(a_2)]_\gamma\Bigg|\dots\Bigg|[TU(a_n)]_\gamma\\
&=\large[TU]_\alpha^\gamma
\end{align*}
(For those vertical bars I meant augmentation of column-vector(s))