WordPress how to override function adjacent_posts_rel_link_wp_head() in link-template.php the correct way

adjacent_posts_rel_link() calls get_adjacent_post_rel_link(), which runs its return value through the {$adjacent}_post_rel_link filter. The dynamic portion of the hook name, $adjacent, refers to the type of adjacency, ‘next’ or ‘previous’.

You can use that filter to change the output accordingly. Here’s an example to change the second parameter:

add_filter( 'next_post_rel_link', function( $link ) {
  return get_adjaxent_post_rel_link( '%title', true, '', false );
} );

add_filter( 'previous_post_rel_link', function( $link ) {
  return get_adjacent_post_rel_link( '%title', true );
} );