How do I get the user ID of the user that was updated in WordPress?

You’re looking for profile_update & user_register.

user_register is called after a user is created.

add_action( 'user_register', 'myplugin_registration_save', 10, 1 );
function myplugin_registration_save( $user_id ) {
    // Do stuff with $user_id
}

profile_update is called after a user is updated.

add_action( 'profile_update', 'my_profile_update', 10, 2 );
function my_profile_update( $user_id, $old_user_data ) {
    // Do stuff with $user_id
}