add_filter( 'woocommerce_get_endpoint_url', 'lab_hook_endpoint', 10, 4 );
function lab_hook_endpoint( $url, $endpoint, $value, $permalink ){
if( $endpoint === 'legacy-account-link' ) {
// ok, here is the place for your custom URL, it could be external
$url = site_url('/account/');
}
return $url;
}