Add 'Bone Collection' to the 'Select Grouped' operator in pose mode. This removes the 'Same Layer' option, and replaces it with 'Same Bone Collection'. It selects all the bones that are in the same collections as the active bone. When there are multiple armatures in pose mode, the bone collections are matched by name.