changing affiliation part of paper
Your affiliation on the front of the paper should be Institute A where you did the work. However you should also provide a current address for readers who may wish to contact you. So simply add a footnote to the paper (often this can be on the front page) stating that your current address and email is is now at Institute B. Once the paper has been published it cannot be changed.