Massachusetts specifically includes sexual orientation and gender identify in the classes that are protected under anti-discrimination statutes. Federal law does not, but in recent years courts have held that these can be protected under the broader umbrella of gender or sex discrimination.
Unlike many other protected classes, your status with regard to sexual orientation or gender identity may not be known to your employer at the time of hire, and may never be known unless you or someone else discloses it. But if you have disclosed in some way- brought a same sex partner to a company event, or requested different pronouns- and experience adverse actions on the job, you may have a discrimination claim.