If you own a condominium - you will have to deal with the bylaws of the Master deed. If there is no provision making it legal in the association I doubt you can changed the Master deed without having a high percentage of owners willing to make the change. So check there first to see if it's legal if you have a condo.
then I would go down to the Inspectional services department for the City of Boston which is located at 1010 Mass Ave. You are more likely to speak with someone if you show up in person. There are city codes and regulations, and then Charlestown may have some neighborhood requirements. 1010 Mass Ave will let you know if there is a Charlestown Historical Commission that also needs to weigh in on the process.
So your answer depends on why it was illegal in the first place!