Better filtering of the model outputs in Trainer
# What does this PR do?

As discovered since merging #8530, sometimes (e.g. when using nvidia apex with the O2 optimization) the new model outputs lose their type and become regular dictionaries. This means we can't index into them with integers and some rework in the internals of `Trainer` has become necessary.

This PR:
- fixes the training by indexing in the outputs by string if they are dict, int otherwise when grabbing the loss
- fixes the evaluation by indexing in the outputs by string if they are dict, int otherwise when grabbing the loss

but it also takes advantage of the new dict outputs to better filter the outputs at inference. We had several issues recently when using models outputing past states (such as Reformer, XLNet, GPT-2) during evaluation in `Trainer`. This PR introduces a new API that looks at a possible key in the config of the model to get some attributes to ignore in the ouputs during evaluation (those outputs are then discarded from the predictions returned by the function `Trainer.predict` or passed along to metric computation in `Trainer.evaluate`). Since a user might have some use cases where they want to ignore more keys or output those keys, a new argument is added to both `Trainer.predict` and `Trainer.evaluate` to fully control the keys ignored in those dictionaries.

If the model outputs tuple, this is all ignored.

Fixes #8523 among others
