Trainer hyperparameter_search only returns the best trial config
### Feature request

Allow `hyperparameter_search` method of `Trainer` to return the entire `ExperimentAnalysis` object instead of  a single `best_run`.

### Motivation

The `hyperparameter_search` method of the `Trainer` currently only returns the best configuration `best_run`, instead of the more comprehensive `ExperimentAnalysis` object `analysis`. However, I believe that `analysis` would be more valuable than just the single best run configuration since it offers additional attributes and methods that can provide more useful information about tuning (see [doc](https://docs.ray.io/en/releases-1.11.0/tune/api_docs/analysis.html#analysis-tune-analysis)). Therefore, I suggest modifying the`hyperparameter_search` method to return the `ExperimentAnalysis` object so that users can do more analysis.

```python
    analysis = ray.tune.run(
        dynamic_modules_import_trainable,
        config=trainer.hp_space(None),
        num_samples=n_trials,
        **kwargs,
    )
    best_trial = analysis.get_best_trial(metric="objective", mode=direction[:3], scope=trainer.args.ray_scope)
    best_run = BestRun(best_trial.trial_id, best_trial.last_result["objective"], best_trial.config)
    if _tb_writer is not None:
        trainer.add_callback(_tb_writer)
    return best_run
```

### Your contribution

I can submit a PR for this feature. 
We'd be happy to look at a PR!<|||||>@sgugger I have a concern regarding the different backends we use (ray, optuna, sigopt, wandb) and their varying return objects. I wonder if we should consider modifying all backends to return a more comprehensive object, such as the `analysis` object used in ray, to ensure consistency across all the backends. 

While I am familiar with the ray tune backend, I am unsure about how to proceed with the other backends. I checked the code briefly to find the object that acts as `analysis` for ray:

1. [study](https://github.com/huggingface/transformers/blob/main/src/transformers/integrations.py#L196) for optuna
2. [entire list of experiments](https://github.com/huggingface/transformers/blob/main/src/transformers/integrations.py#L433) for sigopt
3. [dictionary](https://github.com/huggingface/transformers/blob/main/src/transformers/integrations.py#L433) for wandb (need to modify the dictionary to record results of all experiments instead of the best one.)

Let me know if I understand it correctly.<|||||>I think it's okay if the object is backend specific.<|||||>PR #22040 submitted.