Keeping original URL

If you’re worried about localhost vs. remote after migration then make your links relative.

In the case where you are using the standard wp_nav_menu like;

wp_nav_menu( array(
        'menu' => 'test'
));

Filter the HTML from wp_nav_menu to make all the links relative.

add_filter( 'wp_nav_menu', function( $nav_menu, $args ){

    // get the current site
    $site_url = get_site_url();

    // remove from all links
    $relative_menu = str_ireplace($site_url, '', $nav_menu);

    // return relative menu
    return $relative_menu;

});

If you want to always point to a specific URL no matter when the site is located (local or remote) then add custom links to your menu as absolute paths.