Auto save permalink setting page with the plugin activation

You should use flush_rewrite_rules function for that.

You have to remember, that this is expensive task, so you should not do it every time the site loads (many tutorials are making such mistake).

Of course you can use it in your plugin activation hook:

register_activation_hook( __FILE__, 'myplugin_flush_rewrites' );
function myplugin_flush_rewrites() {
    // call your rewrite rules registration function here (it should also be hooked into 'init')
    myplugin_custom_rewrite_rules_registration();
    flush_rewrite_rules();
}