In order to track the change from in between groups, you’ll need to track the group the ticket was in previously. Easiest method to do that is to use Tags for that.
If the group is changed and a specific tag for Group C is on the ticket, then do stuff and remove the tag for Group C.