you would need to use contactless (theoretically perfect, pretty much impossible given current understanding of physics) superconductors in an absolute vaccum in free space away from all gravitational and electromagnetic influences (including radioactive self decay and particle reassignment) so basically in theoretical deep space, even then the almost incalculably small amount of gravitational influence imposed by the materials that the device was manufactured from would in themselves run away the energy source completely through time even without any kind of working load, even energy from a nearby star would eventually stop flowing (radiating) one day and if the device were powered by ejected mass or radiation, then the incoming energy from the nearest star (sun) would stop passing over/through the device, so power would be lost.. and an internal nuclear power source would expire as well....the same power source would again also exert influences including infrared radiation, electromagnetic fields, particle reassignment, decay ejection energy and microgravity... if charging your battery from say for example downhill motion of a vehicle, and disengaging the coil windings during normal motion (when not going downhill) by using a semiconductor switch, so that magnetic impulse (braking) is not caused then you would be doing what many car manufacturers are doing all the time now.....if you were to place an alternator onto the gearing of your device, the electromagnetic field developed would cause magnetic flux to saturate the windings of the generator which would have the effect of causing magnetic breaking, similar to two magnetic poles opposing each other....the more energy removed the stronger this will become up to the capacity of the device windings and this would have a cancellation effect on the device... Also energy would be lost as: Heat due to friction Inertia transferred to vibration (Acoustic energy) by imperfect surface points and bearing friction..as well as friction from bearing protectant oil, which itself would develop through viscosity. Vibration related friction due to oscillation and gear dithering. Friction against Air. Magnetic Flux generation and ejection of magnetic energy in the form of fields and radio emissions from Electrical interaction (Radio noise) Battery Energy loss through internal resistance, chemical decay and thermal output due to battery chemistry …energy lost through Electrical resistance of components.. Very quickly the output converter (Electric motor) would end up intervening on the input converter (alternator) and they would waste more and more energy to the point where they would cancel and stop, the output device (primary Electric motor) would then overheat and could possibly burn out, as well as damaging the Battery beyond service if enough chemical energy remains stored in the cells of the battery to do so… Using this idea for anything other than downhill vehicle charging would result in a burning smell for definite and possibly a small fire….or worse the Battery