TYP: Replace namedtuple with dataclass #40531
This PR replaces namedtuple with dataclass in pandas/core/groupby/base.py and closes #40531.

The parameters `order` and `frozen` is set equal to True to make sure that that behaviour of OutputKey does not change. 


@github-actions pre-commit

EDIT
----
looks like not all tests get run from the automated commit, so closing and reopening. but then that stopped the azure checks, so I added an empty commit - now all the CI checks  seem to be running fine