(covers information from several alternate timelines)
Treason was the act of betraying one's country, organization, affiliation, or ally, usually to assist the enemy. The most severe cases were sometimes called high treason. One who committed this act was known as a traitor.
Use of the term
In 2257, following the disappearance of the USS Discovery into a wormhole, Spock suggested that all information on the ship, its crew and the Spore drive be sealed and any attempt to mention them would be brought up as treason. This was to prevent the discovery of the ship's true mission and prevent the return of Control. (DIS: "Such Sweet Sorrow")
In 2259 of the alternate reality, Montgomery Scott asked Captain James T. Kirk to beam him off the USS Vengeance, noting that he had committed treason against Admiral Alexander Marcus by sabotaging the ship. (Star Trek Into Darkness)
Various Starfleet-related acts of treason and traitors have been uncovered throughout history.
In 2365, Worf told Geordi La Forge, who was being held captive by Pakleds, that it would be treasonous to give them classified tactical information. This was part of a ruse to rescue La Forge by making the Pakleds believe he was a weapons expert. (TNG: "Samaritan Snare")
In 2368, Toral, son of Duras stood convicted of treason for his role in the Klingon Civil War and attempt to take the role of Chancellor from Gowron. His life was given to Worf to do with what he wished. Worf chose to spare him. (TNG: "Redemption II")
In 2370, Data told William T. Riker that he could not give orders because of the charges he faced upon his return from Arctus Baran's ship, having been declared a renegade. Treason was one of the charges he mentioned. (TNG: "Gambit, Part II")
In 2390 in an alternate timeline, in which the USS Voyager crashed in the Takara sector, both Harry Kim and Chakotay were wanted on two counts of high treason and conspiracy to violate the Temporal Prime Directive for their plan to prevent the incident from happening. (VOY: "Timeless")