You can do it in multiple ways.
Use can pil Library directly for rotation as pytorch uses pil for this kind of image operations.
Another simple way I can think of is use random rotation class itself. But give the min and max with the same value.
If you want to write.a proper class, copy the random rotation class source code and change the way you need it to be like getting the rotation angle alone.