You can't expect to use a generator while running the motor and generate any net charge. The losses will always be more then the generator can supply (otherwise you would have perpetual motion). The only time you would want the generator to be connected would be when you are coasting downhill, or using pedal power.
You could use a large schottky diode (which have a lower forward drop then a regular junction diode) to isolate the generator so current will only go out, not in.
This brings up a question: Can the hub motor also be used as a generator?