You do it in 2 steps:
1) generate adapter code, using normal adapter templates/config
2) generate derived entity classes, using derived entity classes config / templates. In this step, you specify a different rootnamespace and a different destination folder.
You add the code in step 2 to a new vs.net project and in that project you reference the generated code of step 1) (the db generic project).
To automate this, you can use the commandline generator (see 'extras' section in the customer area) and call it 2 times in a row in a .cmd file, one for step 1 and one for step2.