I) The (Lagrangian) canonical conjugate momentum
$$\tag{1} p_i ~:=~\frac{\partial L(q,\dot{q},t)}{\partial \dot{q}^i} $$
transforms as a one-form/co-vector
$$\tag{2} p_i~=~ p^{\prime}_j \frac{\partial f^j(q,t)}{\partial q^i} $$
under (possibly time-dependent) position coordinate transformations
$$\tag{3} q^i~\longrightarrow~ q^{\prime j}~=~f^j(q,t)$$
in the position manifold $M$ (aka. as the configuration space). The Lagrangian $L(q,\dot{q},t)$ and the velocity $\dot{q}^i$ transform a scalar
$$\tag{4} L(q,\dot{q},t)~=~L^{\prime}(q^{\prime},\dot{q}^{\prime},t) $$
and an affine vector
$$\tag{5} \dot{q}^{\prime j}
~=~
\dot{q}^i \frac{\partial f^j(q,t)}{\partial q^i}
+\frac{\partial f^j(q,t)}{\partial t}$$
under general position coordinate transformations (3), respectively. Equation (5) implies that
$$\tag{6} \frac{\partial \dot{q}^{\prime j}}{\partial \dot{q}^i}
~\stackrel{(5)}{=}~\frac{\partial f^j(q,t)}{\partial q^i}. $$
Equation (2) follows because of eqs. (1), (4), (6) and the chain rule:
$$\tag{7} p_i ~=~\frac{\partial L(q,\dot{q},t)}{\partial \dot{q}^i}
~=~ \frac{\partial \dot{q}^{\prime j}}{\partial \dot{q}^i} \frac{\partial L^{\prime}(q^{\prime},\dot{q}^{\prime},t)}{\partial \dot{q}^{\prime j}}
~=~ \frac{\partial f^j(q,t)}{\partial q^i}p^{\prime}_j.$$
II) Let us mention for completeness that in the Hamiltonian formalism the momenta $p_i$ are independent variables. The set of transformations (2) and (3) is not the most general phase space transformation
$$\tag{8} (q^i,p_j)~\longrightarrow~(q^{\prime i},p^{\prime}_j) =(f^i(q,p,t),g_j(q,p,t)), $$
even if the phase space is the cotangent bundle $T^{\ast}M$ and even if we restrict to symplectomorphisms.
One may check that a phase space transformation (8) of the form (2) and (3) is a symplectomorphism. In fact, it is a type 2 canonical transformation (CT) with generating function
$$\tag{9} F_2(q,p^{\prime},t)~=~ p^{\prime}_j f^j(q,t). $$
For the definition of a CT, see also this Phys.SE post. From a Hamiltonian point of view, the set of transformations (2) and (3) are the transformations that respect the fiber structure of the cotangent bundle $T^{\ast}M$. However, we should stress that the full set of symplectomorphisms is vastly bigger than the set of transformations (2) and (3). In other words: The symplectic structure is coarser than the cotangent bundle structure.
Example: The phase space transformation
$$\tag{10} q^{\prime i} ~=~ p_i \quad\text{and}\quad p^{\prime}_j ~=~-q^j $$
is not of the form of eqs. (2) and (3). However, it is a symplectomorphisms and a type 1 CT with generating function
$$\tag{11} F_1(q,q^{\prime},t)~=~ q^{\prime i} q^i. $$
The fact that the upper and lower indices in eqs. (10) and (11) do not match reflects that the symplectomorphism (10) does not respect the fiber structure of the cotangent bundle $T^{\ast}M$.
References:
- M. Nakahara, Geometry, Topology and Physics, 2003; Subsection 1.1.3.