Hey!
There's no information (or I didn't find any) about replacing Vanilla classes.
Some vanilla classes, like industries, abilities and contact missions, are specified in their CSVs, so you just change the classname specified there.
For other things (pirate base generation is one), the class instance is generated by the game's "lifecycle plugin". You have to either replace that plugin (not recommended for compatibility reasons), or else run code that removes the existing script and adds your own.
For detailed help, I'd suggest a new thread in Modding, or the Misc modding questions thread.