The groups that are created in OS is saved to a table called "SecGroups" in the database. In your case if GroupA and GroupB exists. Get the UniqueID's of the GroupA and GroupB.
"SecGroupChild" table will have the group and child relation (this table will give you the list of GroupA - Users rows).
Read all rows that has GroupKey (GroupA), ChildKey (User).. to a dictionary, Update the GroupA key with GroupB key in the dict and then insert the rows to the SecGroupChild.
You can create a Dashboard where you can display the Groups, Users and add a button, Admin can then click the button which will then insert the rows in SecGroupChild group. If needed can add additional check, if specific users have to have access to the GroupB...