How To Alter Web Form Elements Permanently?
You can alter the yaml source of a webform by loading the config entity and modify elements:

use Drupal\webform\Entity\Webform;
use Drupal\Core\Serialization\Yaml;

  $webform = Webform::load('contact');
  $elements = Yaml::decode($webform-&gt;get('elements'));
  $elements['name']['#title'] = 'Please fill in your name';
  $webform-&gt;set('elements', Yaml::encode($elements));
  $webform-&gt;save();