Localization of JavaScript which is only used in one page

You can add conditional statements inside the wp_enqueue_scripts action hook.

add_action( 'wp_enqueue_scripts', function() {
   if( is_page( 'page-slug' ) ) {
      // Enqueued script with localized data.
      wp_enqueue_script( 'register-validation-js' );
   }
} );

You can refer to the is_page documentation for more information on what arguments can be pass.