How to add field to menu
In hook_form_alter() add a submit function:

$form['#submit'][] = 'my_module_menu_edit_submit';


Where you store the field:

function my_module_menu_edit_submit($form, FormStateInterface $form_state) {
  $config = \Drupal::service('config.factory')-&gt;getEditable('mymodule.settings');
  $config-&gt;set('main_content', $form_state-&gt;getValue('field_menu_content'))
    -&gt;save();
}


The main menu is hard coded in the settings name. If you want this to work for all menus, you can try to get the menu name from the form. I did not investigate where you can get it.

When you build the form field you also need to get the field value from config. More information: https://www.drupal.org/docs/8/api/configuration-api/simple-configuration-api