Improve torch.fx support to trace non torch objects
# What does this PR do?

Improve `torch.fx` support to be able to track non tensor/parameter/module attributes. For example the new tracing mechanism allows to trace `config`, `num_heads` etc ... attributes that are important if one wants to build transformations on top.

Caveat: tracing such objects prevents `torch.jit.script` to work correctly due to limitations on their end. Consequently we gate the feature behind `trace_non_torch_object` flag upon tracing which defaults to False. (We could default to True, but that's a breaking change)

```
E   AssertionError: Could not TorchScript the traced model: 
E   Module 'GraphModule' has no attribute 'config' (This attribute exists on the Python module, but we failed to convert Python type: 'transformers.models.gpt2.configuration_gpt2.GPT2Config' to a TorchScript type. Only tensors and (possibly nested) tuples of tensors, lists, or dictsare supported as inputs or outputs of traced functions, but instead got value of type GPT2Config.. Its type was inferred; try adding a type annotation for the attribute.):
E     File "<eval_with_key>.0", line 5
E   def forward(self, input_ids : torch.Tensor, token_type_ids : torch.Tensor):
E       config = self.config
E                ~~~~~~~~~~~ <--- HERE
E       config_1 = self.config
E       config_2 = self.config
```
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_18765). 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.