For more complex season definitions, use the new SeasonResampler object in Xarray>2025.04.0:
import xarray as xr
from xarray.groupers import SeasonResampler
ds = xr.tutorial.open_dataset("air_temperature")
ds.resample(time=SeasonResampler(["DJFM", "AMJ", "SON"])).mean()
https://docs.xarray.dev/en/latest/user-guide/time-series.html#handling-seasons