Programatically change the base theme of the current theme
So as it turns out an info.yml file can be altered inside HOOK_system_info_alter

To change the base theme definition of an existing theme you can use the following 

function HOOK_system_info_alter(&amp;$info, $file, $type) {
  if ($type == 'theme') {
    if ($info['name'] == 'YOUR THEME NAME') {
      $info['base theme'] = 'NEW_BASE_THEME_NAME';
    }
  }
}


As this hook is only fired when caches are flushed there is no need for a separate cache flush after the change is made.