The simplest method, which you will find in a number of stair-stepper, elliptical and stationary bicycles at the gym is to use an automotive alternator. These have the advantage of a wound field, so it's possible to vary the field current, which will be much lower than the output current, by either changing the voltage applied, or use of PWM from a fixed supply, and dissipating the generated output in a load resistor. This also has the advantage of being able to generate the supply for the control electronics and display.
With a permanent magnet machine, you would have to control the generated current, with what would effectively be a controllable constant current load.
This works for rotary motion, and for reciprocating or linear motion you can arrange some kind of linkage to translate that to rotary - the stair steppers use a chain drive. Alternatively, you could use a eddy current or hysteresis brake, where the moving element (aluminum or copper for eddy current, steel for hysteresis) passes through the magnetic field generated by an electromagnet. Transformer E laminations work well for making these.