DISMUI does this in a safe way because it is checking for packages that are used by other installed modules before removing them.
Even though this works using this feature might not be supported by Microsoft but it helps you a lot during the image building process or even just for testing.
Using the new feature is easy: Just uncheck the module that should be removed and confirm the warning message. Then continue as usual – DISM does the rest for you!