Let $\mathcal{L}(\boldsymbol{q}, \dot{\boldsymbol{q}},t)$ be the lagrangian of a certain system with $n$ degrees of freedom. By definition of Legendre transformation (not Legendre-Fenchel) the lagrangian hessian matrix with respect to generalized velocities:
\begin{equation} \left(\frac{\partial^2\mathcal{L}}{\partial\dot{q}^i\partial\dot{q}^j}\right) \tag{1} \end{equation}
has to be positive definite. If the lagrangian is of the form: \begin{equation} \mathcal{L}=T-U \tag{2} \end{equation} Where $T$ is the kinetic energy and $U$ is a generalized potential, it can be proved that for a mechanical system $(1)$ is positive definite (it's the matrix of the quadratic form associated to $T$). On the other hand, I've seen some only require that \begin{equation} \det\left(\frac{\partial^2\mathcal{L}}{\partial\dot{q}^i\partial\dot{q}^j}\right)\neq0 \tag{3} \end{equation} (non degenerate lagrangian) that means that the system:
\begin{equation} \frac{\partial \mathcal{L}}{\partial\dot{q^j}}=p_j\qquad j=1...n \end{equation}
is invertible. This condition is necessary, though, it does not guarantee $(1)$ to be positive definite and thus the requirements of legendre transformation. So why is $(3)$ in some context used as a condition to perform the Legendre transform of the lagrangian?