Zend certified PHP/Magento developer

how to write php script for saving admin configurations in magento 2

I want to write a script that saves the admin configuration everytime when I deploy/upgrade.
For example, I need to have a php script for saving this admin configuration.
Admin panel -> stores-> configuration -> catalog -> inventory ->
Display out of stock products -> YES.
Can anyone tell me how to do this?
Thanks in advance..