Have a look at the python/isaacgym/torch_utils.py script. It has different functions such as get_euler_xyz(q) which you can use to convert a tensor (matrix) of quaternions to Euler angles. There are also other interesting functions that you might find useful!
And I would also refer to the pytorch3d library which has documentation for similar functions. From this library, I have used the 6D representation to achieve better results than when I used quaternions based on this paper.