I want to change the slugs of my terms dynamically

As far as I got you right, the following code is all you need to solve this.

function my_function( $post_id ){
if ( ! wp_is_post_revision( $post_id ) ){
    $post = get_post( $post_id );
    $my_args = array(
        'ID'        => $post_id,
        'post_name' => ''
    );
    // unhook this function so it doesn't loop infinitely
    remove_action( 'save_post', 'my_function' );
    // update the post, which calls save_post again
    wp_update_post( $my_args );
    // re-hook this function
    add_action( 'save_post', 'my_function' );
}
}
add_action( 'save_post', 'my_function' );

See wp_update_post in the codex.

I just tested the code in WordPress 5.1 with the block editor.