I believe this should be done via access transformer i.e. via https://github.com/MinecraftForge/MinecraftForge/blob/6ff7584f962e4e3f60c7246d190779da7a5de5d6/src/main/resources/forge_at.cfg