Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
You can use a workflow variable too if you do not want to deal with roles but the UI will look a bit funny. Yes, you can use a transition but make sure you call code in an external method so its possible to patch bugs. This method would get the team of the change activity and update the role member for Task B. Should work well but test, test, test and make sure there is a responsible role in place to catch exceptions.
@BrianSullivan , very doable.
There are APIs you can use to get how complete the task.
Run code in complete transition of task A and populate the team role for task B with the user who completed task A all in one shot.
I agree with @avillanueva , I’d always use external class. You never know when you might want to use the same code again somewhere else.