Windows Server Manager lets you export the configured roles and features from the UI dialogue as an xml file. Unfortunately there is no possibility to directly work with this xml file. The following script shows a simple way to parse the xml file. You can then pipe the output to for example to the Install-WindowsFeature cmdlet.