Too high voltage on the generator

ManFish:
The problem is that i measured a 7.3 V on the generator when setting the PWM to 255 (for the first motor). Since the motor (generator) operating voltage ,according to the datasheet, is 1.5 - 6.5 V this could damage the motor.

I assume the PWM signal is applied to motor A and the voltage is measured on Motor B acting as a generator? I presume there is no electrical connection between motor and generator?

That voltage won't do the generator any harm. If it was 100v I might worry about damage to the insulation. What will damage the motor/generator is excessive current causing it to overheat. The voltages specified for the motor are those which allow it to work as a motor without a too high current flowing. When used as a generator I would expect the motor to be very inefficient and only capable of producing a very small current at 7.3v.

...R