hook into preprocessor

There is a list of hooks here:

but I'm guessing recipe.hooks.sketch.prebuild.NUMBER.pattern actually happens after the sketch preprocessing. Is that correct?

I don't see any reason why you would need your generated file to be run through the preprocessor though. How about turn it into a .h file and copy it to the temporary build folder. It would be brought into your sketch by an include of the generated .h file. If you do that then recipe.hooks.sketch.prebuild.NUMBER.pattern should work fine for your needs.