When the divorce is finalized, then you can legally re-marry. The divorce is not finalized at the final hearing date, however. As far as how long you need to wait before you can remarry, you'll need to wait either 90 days or 120 days, depending on whether your divorce was contested or uncontested. The judgment of divorce nisi should tell you the date that it becomes effective.
Gabe is correct. There are cases where people wed before the nisi period ends, and while this is bigamous in nature, being married after the nisi period can affirm an otherwise suspect marriage.
If you are getting a divorce in Massachusetts, then you are not legally divorced until the waiting period is over, 90 or 120 days after the final hearing. You are not divorced in Massachusetts and you are not divorced anywhere. It's not a matter of moving from state to state.