Fixes Loss for TransfoXL when using Trainer API v2
Reopens https://github.com/huggingface/transformers/pull/14568#issue-1066398357 with backward-compatible mechanisms
_The documentation is not available anymore as the PR was closed or merged._