I think the best way would be using mouse_pos3d or mouse_dir3d. I thought mouse_pos3d gave you the 3D coordinate of the mouse, so i tried setting the entity's position to that but it flies to a random position.

Are their any more examples of creating a transform gizmo?