I am not certain on how to do exactly what you are asking but this information may be helpful.
The modification would be in the ~/.config/libreoffice/4/user/registrymodifications.xcu
file.
I did a early adoption of thems in OooDev.
You can see the source here. Unfortunatally it is not working 100%. LibreOffice made some changes along the way that made this difficult to implement. For example I have not figured out how to accurately detect the current theme since LibreOffice has made changes.
I am not sure about this but:
Maybe you could capture the changes in registrymodifications.xcu
after the theme has been changed by using a Diff editor to find them and then create or add to an exising file in /etc/libreoffice/
directory.
I found: /usr/lib/libreoffice/program/fundamentalrc
that contains
CONFIGURATION_LAYERS=xcsxcu:file:///etc/libreoffice/registry res:file:///etc/libreoffice/registry dconf:* bundledext:${${BRAND_BASE_DIR}/program/lounorc:BUNDLED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini sharedext:${${BRAND_BASE_DIR}/program/lounorc:SHARED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini userext:${${BRAND_BASE_DIR}/program/lounorc:UNO_USER_PACKAGES_CACHE}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini user:!${$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}/user/registrymodifications.xcu
This seems to point to the configuration that are include when LibreOffice starts.
In the Live LibreOffice Python project I copy user setting over when the Codespace is being constructed. See the defaults code.
Basically copy registrymodifications.xcu
with theme setting into ~/.config/libreoffice/4/user/registrymodifications.xcu