Section 2. In construing sections 69G to 69O, inclusive, 70, 71, 74 to 83, inclusive, 92 to 95, inclusive, 103, 105, 106, 109, 112 to 114, inclusive, 116, 117, 119, 120, 121, 123 to 127, inclusive, unless the context otherwise requires, the terms ''corporation'', ''gas company'' and ''electric company'' shall include (i) all persons, firms, associations and private corporations which own or operate works or a distributing plant for the manufacture and sale, or distribution and sale of gas for heating and illuminating purposes, or of electricity, within the commonwealth, or (ii) or a transmission company that is affiliated with an ''electric company'', but shall not include any alternative energy producer other than persons, firms, associations, and private corporations expressly excluded from the definition of ''electric company'' in section 1; and in construing sections 103, 105, 109, 112 to 114, inclusive, 116, 117, 120, 121, and 123 to 127, inclusive, the terms ''corporation'', ''gas company'' and ''electric company'' shall include municipal corporations which own or may acquire municipal lighting plants. Electric companies, which engage in generation and which are not part of a vertically integrated electric company or do not have a distribution affiliate in the commonwealth, shall be exempt from sections 3 to 33, inclusive, and section 93. Electric companies, which engage solely in the transmission or transmission and sale of electricity, shall be exempt from this chapter to the extent that they are preempted by federal law.