Update generic.py
Added documentation on head and tail methods. Parameter n can be larger than the object size.

- [x] closes #46073

Hello @benjamrio! Thanks for opening this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:

* In the file [`pandas/core/generic.py`](https://github.com/pandas-dev/pandas/blob/f31746d4726174cee9a7362f6a76c93b40c6e0ed/pandas/core/generic.py):

> [Line 5164:1](https://github.com/pandas-dev/pandas/blob/f31746d4726174cee9a7362f6a76c93b40c6e0ed/pandas/core/generic.py#L5164): [W293](https://duckduckgo.com/?q=pep8%20W293) blank line contains whitespace
> [Line 5165:89](https://github.com/pandas-dev/pandas/blob/f31746d4726174cee9a7362f6a76c93b40c6e0ed/pandas/core/generic.py#L5165): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (97 > 88 characters)
> [Line 5170:38](https://github.com/pandas-dev/pandas/blob/f31746d4726174cee9a7362f6a76c93b40c6e0ed/pandas/core/generic.py#L5170): [W291](https://duckduckgo.com/?q=pep8%20W291) trailing whitespace
> [Line 5240:89](https://github.com/pandas-dev/pandas/blob/f31746d4726174cee9a7362f6a76c93b40c6e0ed/pandas/core/generic.py#L5240): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (97 > 88 characters)
> [Line 5241:1](https://github.com/pandas-dev/pandas/blob/f31746d4726174cee9a7362f6a76c93b40c6e0ed/pandas/core/generic.py#L5241): [W293](https://duckduckgo.com/?q=pep8%20W293) blank line contains whitespace
> [Line 5245:38](https://github.com/pandas-dev/pandas/blob/f31746d4726174cee9a7362f6a76c93b40c6e0ed/pandas/core/generic.py#L5245): [W291](https://duckduckgo.com/?q=pep8%20W291) trailing whitespace

