Mechanical energy is the sum of kinetic energy and potential energy:

EM = EP + EK

Thus, a transformation of kinetic energy into potential energy (or the other way around) does not alter the mechanical energy of a system.

Mechanical energy is not the same as total energy, since there are other types of energy besides kinetic and potential.