The precision of quantum sensing could be improved by exploiting quantum phase transitions, where the physical quantity tends to diverge when the system approaches the quantum critical point. This critical enhancement phenomenon has been applied to the quantum Rabi model in a dynamic framework, showing a promising sensing enhancement without the need for complex initial state preparation. In this work, we present a quantum phase transition in the coupling cavity-mechanical oscillator system when the coupling strength crosses a critical point, determined by the effective detuning of cavity and frequency of mechanical mode. By utilizing this critical phenomenon, we obtain a prominent enhancement of quantum sensing, such as the position and momentum of the mechanical oscillator. This result provides an alternative method to enhance the quantum sensing of some physical quantities, such as mass, charge, and weak force, in a large mass system.