How to create transform controls similar to Threejs transform controls

Hi,
I am creating transform controls for my application . It contains only rotation controls , not translators. Meaning just only three , half torus geometries .
If I look at threejs Rotating controls , while rotating the world , the red , green , blue , rotators also rotating beautifully. We can see it as like animation . Unfortunately I cannot use transformControls from three js directly , So I am creating one manually .
I have done creating manipulator, but don’t know how to apply rotation on these torus geometries while rotating the world.
image

I have gone through how transform gizmo , is implemented in threejs . But couldn’t understand it thoroughly .
My requirement is while rotating the world , my red , green , blue circles also should rotate like smooth animation (as it works in threejs controls).

Can anyone help me understanding how to implement the same.