How can I create Menu items through hook_install()?
You can use hook_menu_links_discovered_alter() to modify or add additional links to those provided in *.menu.links.yml files, but these types of links are not completely editable (e.g. you can not change their title in the UI).

If your links are content based, need to be completely editable later through the UI, or are being placed in a custom menu you can directly create the menu link entities:

MenuLinkContent::create([
  'title'      =&gt; 'My internal link from a route name',
  'link'       =&gt; ['uri' =&gt; 'route:myroute'],
  'menu_name'  =&gt; 'my-menu',
])-&gt;save();


Also check out the Entity API documentation, and Working with the Entity API for more information.