It would be good to have a per-network setting to toggle storing of stale blocks in the database. These can then be exported or exposed via the API and used in e.g. https://github.com/bitcoin-data/stale-blocks.
The blocks should be stored in a separate table. Docs should mention that this is only recommended for mainnet, as other networks might have many stale blocks.