I need to save a style file (.qml) that will only contain the "Symbology", "Labeling", "Forms" categories. With PyQGIS I can save a named style like this:
lyr = iface.activeLayer()
path = f'C:\\Users\\Path\\To\\Save\\Directory\\{lyr.name()}.qml'
if lyr.type() == QgsMapLayerType.VectorLayer:
lyr.saveNamedStyle(path)
How can I save a .qml style file with a subset of style categories?