I figured out how to do it now. Using the API documentation here is quite good:
https://ultimatemember.com/php-docs/classes/UM.html
add_action( 'gform_after_submission_2', 'after_submission_change_role', 10, 2 );
function after_submission_change_role($entry, $form) {
$user_id = get_current_user_id();
UM()->roles()->set_role( $user_id, 'um_full-member' );
}
Thanks!