Do a POST request to the URL /t/[TOPIC_ID]/change-owner.json with the form data post_ids[] and username.
/t/[TOPIC_ID]/change-owner.json
post_ids[]
username