Response of Critical Temperature of the Superconducting Transition and Energy Gaps of MgB$_2$ to the Hydrostatic Compression