what do you call a device that transform mechanical energy into electrical energy​