In local coordinates the canonical transformation to action angle coordinates $(q,p)\rightarrow (Q,P)$ can be related by,
\begin{equation}
\boxed{P_i=\frac{1}{2\pi}\oint p_idq^i \ \ \ \ \ \text{and}\ \ \ \ \ Q^i=\frac{\partial }{\partial P_i}\int p_idq^i}
\end{equation}
For Example:
Consider the one dimensional harmonic oscillator with the following Hamiltonian $H=\frac 1{2m}\big[p^2+m^2\omega ^2q^2\big]$. Rearrange this for $p$ and take the hypersurface $H=E$.
\begin{equation}
p=\pm \sqrt{2mE-m^2\omega ^2q^2}
\end{equation}
Then use the above equation to compute $P$.
\begin{equation}
P=\frac{1}{2\pi }\oint \sqrt{2mE-m^2\omega ^2q^2}dq
\end{equation}
The integral is now over $0$ to $2\pi$ which is easier to handle. This works out as,
\begin{equation}
\frac {1}{2\pi}\oint ^{2\pi}_{0}\cos^2Q\ dQ\cdot \frac {2E}{\omega}
=\frac{E}{\omega}
\end{equation}
Therefore we have used the quoted formula to compute the action variable for the harmonic oscillator.