Applying equal transformation on label as on image (e.g. RandomPerspective())

Different approaches are discussed in e.g. this issue or this one.
My suggestion would be to use the functional transformation API, grab the parameters for each transformation, and apply it to the image and target as seen here.