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. 

