Make FlaxPreTrainedModel a Flax Module
# What does this PR do?

WIP. Makes `FlaxPreTrainedModel` a `nn.Module` so Flax users can easily integrate it into other Flax networks or systems that expect Flax Modules. 

See for #22499 some discussion of the approach.

@sanchit-gandhi's previous comment:

"""


This looks super clean @cgarciae - really like this way of making the FlaxPreTrainedModel into an nn.Module through dataclasses.

Had some questsions about the PR (mainly for my understanding), but think the general design philosophy looks good here.

From my testing it all seems to work as expected - think though we should add some very visible warning messages though when a user passes _do_init=False to advise them to use the returned model as a Flax nn.Module (rather than falling-back on the __call__ method of FlaxPreTrainedModel). This is the only breaking change I see from this PR, but one that is unavoidable (since it's the exact thing we're trying to change).

=> perhaps as a start we first make a PR that triggers this warning (advising users that the functinality is going to change in N months / releases time), and then have this PR as a follow-up that makes the changes?

For Flax BERT though this approach gives equivalence between the FlaxPreTrainedModel and the nn.Module -> for models that do extra pre-processing we can just modify the __call__ to do all the data pre-processing?

"""<|||||>Thanks for the review @sanchit-gandhi !

> => perhaps as a start we first make a PR that triggers this warning (advising users that the functinality is going to change in N months / releases time), and then have this PR as a follow-up that makes the changes?

I was planning on entirely deleting the `params` argument from `__call__` 😅. If we want to make the change a bit more gradual then maybe we could do something like this:

```diff
- if self._do_init:
+ if self.scope is None:
```
This would condition on whether the module being called inside `apply` or not.<|||||>@sanchit-gandhi cleaned the PR a little, these are the minimal changes required.<|||||>The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_22627). All of your documentation changes will be reflected on that endpoint.<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.<|||||>Leaving closed in favour of #22866<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.