On a class of transformations of copulas and quasi-copulas