Add preprocess_logits_for_metrics Trainer param
# What does this PR do?

In addition to what I told in the issue, I thought adding labels as a parameter to the preprocess function could be useful with no cost. This forced me to change the order of the accumulation of labels and logits, which creates an asymmetry with respect to the other code blocks. I could change the order in those too, but I tried to change as little as possible.

With regards to adding the computation of perplexity in the examples run_clm or run_mlm, do you mean accuracy? Maybe I'm missing something, but the way I calculate perplexity having the loss is enough. 
Moreover, those examples don't pass `compute_metrics` either to the Trainer. 

I can add the computation of accuracy to the examples, using the new parameter to precompute the argmax, although it could still slow down the examples a bit.

cc @sgugger 

Fixes #15466





_The documentation is not available anymore as the PR was closed or merged._<|||||>Thank you! I just added the accuracy to the language modeling examples and the doc change you requested.

I haven't worked with masked language models, so please check the `run_mlm` example is ok. I think the unmasked labels get the same -100 id as the padding, but maybe there's something I'm not thinking about.<|||||>I don't think you pushed your changes, you mentioned adding content.<|||||>No, sorry, maybe I expressed it poorly, I meant that I had added the same comment originally.<|||||>Thanks for your contribution!<|||||>Suspecting this PR introduced a breakage - please see: https://github.com/huggingface/transformers/issues/15898
