I'm on mobile so cannot check further right now, but I believe the extender you are using is specifically for serializers based on Eloquent models. But the forum serializer is not based on a model, and therefore doesn't have Eloquent relationships.
The relations on the forum serializer are all hard-coded data. There's another extender hook for before data serialization that can be used for this.
What are you trying to do though? The groups
relation is not a real relation. If you want to make some groups invisible, you should use a visibility scoper. If you want to pre-load specific groups to render in a dropdown list in your extension UI, you should create a new virtual relationship with a unique name, or load the data asynchronously from an API endpoint when needed.