They inherit from nn.Module for two key reasons;

It makes the transforms runnable on GPUs.
It makes them compatible with TorchScript.

Unless either of these are important to your specific application, you can safely implement your custom transforms without inheriting from nn.Module.