I need to understand how starting from the free Lagrangian
$$
\mathscr{L} = \bar{q}(i \not\partial - \hat{m})q
$$

and based on the chiral angle associated with the pion field and the quark field rotated by the chiral transformation
$$
q'= \exp\left[i\dfrac{\pi \cdot \tau\gamma^5}{2 f_\pi} \right]q
$$

arrive at
$$
\mathscr{L} = \bar{q}(i \not\partial - M)q - \dfrac{1}{2f_\pi}\partial_\pi \pi\cdot\bar{q}\gamma^5 \tau q - i \dfrac{\hat{m}}{f_\pi}\pi \pi\cdot\bar{q}\gamma^5 \tau q + \dfrac{\hat{m}}{2 f_\pi^2}\pi^2\bar{q}q
$$

where the quark field operators $q'$ are written as $q$.