Support custom StoppingCriteria in model.generate
# 🚀 Feature request

<!-- A clear and concise description of the feature proposal.
     Please provide a link to the paper and code in case they exist. -->

It could be helpful to support custom StoppingCriteria in `model.generate`.

Currently, `model.generate` implemented in generation_utils.py ([permlink](https://github.com/huggingface/transformers/blob/68d925195ede14826dd0e83258b64c2222133988/src/transformers/generation_utils.py#L747)) does not support supplying a custom StoppingCriteria in function arguments.

We could add a `stopping_criteria` argument in the function, and use the supplied criteira to control the generation progress.

## Motivation

<!-- Please outline the motivation for the proposal. Is your feature request
     related to a problem? e.g., I'm always frustrated when [...]. If this is related
     to another GitHub issue, please link here too. -->

I am a NLP researcher and recently I have been using GPT-J provided by transformers to follow the Codex research conducted by OpenAI (Codex [paper](https://arxiv.org/abs/2107.03374)), where I found it useful to supply a custom StoppingCriteria when generating source code (stop when encountering a new function/class definition).

## Your contribution

<!-- Is there any way that you could help, e.g. by submitting a PR?
     Make sure to read the CONTRIBUTING.MD readme:
     https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md -->

This may be as simple as appending the user-supplied criteria [here](https://github.com/huggingface/transformers/blob/68d925195ede14826dd0e83258b64c2222133988/src/transformers/generation_utils.py#L1109).

Hi @Linyxus , passing custom criteria is now supported, see #14779<|||||>Thank you! :D