Generally, you need to get permission to leave the state with
your child if you are divorced and you either need to get permission from the
other parent and/or a judge before you move away from Massachusetts. 

If you are still married to the other parent and you are not
divorced, have not filed a divorce action, and the spouses share physical and legal
custody of the child; which means that it is lawful to move the child from the state
but it is strongly recommend that you speak to an attorney before removing the
child on your own without an agreement of the other party or filing something
in court because a judge might not take kindly on you making a unilateral
decision when both parents have similar rights.

If you never married to the other parent, even if you have custody
of the child you might still be well advised to seek the parent’s agreement or
permission from a judge if there is no agreement. However, it should be looked
at carefully to see whether there is a need to get permission. The children who
are born to parents who are not married to each other, shall still be entitled
to the rights and protection of laws but there is some reason why you may not
need permission.

If you are a victim of domestic violence, some exceptions in
order to remove the child from Massachusetts if it is essential to the child’s
being safe.  Again, it would well advise
to speak to an attorney on any of these questions.