$dp_i$ is a 1-form on $T^{*}M$ and $P$ is a smooth map $P \colon TM \rightarrow T^{*}M$, so it makes sense to consider the pullback $P^{*}dp_i$ which is a 1-form on $TM$. Concretely, it just means express $p_i$ as a function of $q$ and $\dot{q}$ and then compute $dp_i$ as a function of $dq$ and $d\dot{q}$. An immediate application of the chain-rule gives the formula in the question.
This formula is quite relevant because it tells you that to recover $\dot{q}$ from $p$ (and in particular, to have $P$ diffeomorphism, which is not always the case!), you need to be able to invert the matrix of components
$\frac{\partial^2 L}{\partial\dot{q}^j\partial\dot{q}^i}$.
If you can do it, you obtain an equivalence between the Lagrangian dynamics on $TM$ and the Hamiltonian dynamics on $T^{*}M$. If you can't do it, then the Hamiltonian dynamics on $T^{*}M$ is under-determined and the correct Hamiltonian dynamics equivalent to the original Lagrangian dynamics lives in general on a quotient of a submanifold of $T^{*}M$. It is exactly what happens in gauge theories.