Making a username/password syncronization scheme - D7
When a form is submitted, its values are validated by the functions listed in $form['#validate'] then processed by the functions in $form['#submit']. If there is no $form['#validate'], then the function FORM_NAME_validate will run (if any). Same for submit. 

See user_register_submit. The plain text password is in $form_state['values']['pass']. Write a hook_form_alter and add a new submit function to $form['#submit']. Declare that function and put the logic you need in it.