I think the best way to get this information is:
systemctl list-unit-files | grep masked
Or, for unit names only:
systemctl list-unit-files | awk '/masked/ {print $1}'
Of course, any of these expressions will actually match the units that contained "masked" in the name. More accurate would be:
systemctl list-unit-files | awk '$2 == "masked" {print $1}'
source share