Rewrite Url to a SEO-friendly format

The easiest way to do this is with the built-in $wp_rewrite global. Something like this should give you a good start:

function new_rewrite_rules(){
    global $wp_rewrite;
    $keytag = '%user_id%';
    $wp_rewrite->add_rewrite_tag($keytag, '(.+?)', 'user=");
    $structure = $wp_rewrite->root . "username-$keytag/";
    $rewrite = $wp_rewrite->generate_rewrite_rules($structure);                
    if(!is_array($wp_rewrite->rules)) $wp_rewrite->rules = array();
    $wp_rewrite->rules = $rewrite + $wp_rewrite->rules;
    return $wp_rewrite->rules;
}

You would then access your variable inside the loop via $wp_query->query_vars["user'].

Note that this only makes your URL schema valid, in order to make the new url display you’ll have to change the way links are generated in the membership plugin so that they match your schema. Ideally, the plugin will have a filter that lets you change it.