To be honest, I think that is is a very special application where you need this and don’t have it conveniently available.
For example, (I think) the fast.ai library (Jeremy Howard advocates a graded learning rate for finetuning) library sticks the various modules in a Sequential module and then gets the parameter groups by iterating over the submodules.
The other option is to use the parameter names, there probably are more elegant solutions than the above if you need it in a systematic way.