Are you looking to do this in Pixelmator Pro? At the moment, there are only shortcuts for grouping and ungrouping layers, but there aren't any for expanding and contracting layer groups. We do have this feature on the request list so I can add your +1 for it.