Electromechanical device that converts mechanical energy to electrical energy in the form of alternating current