A historian is a scholar who researches and interprets past events in the field of study known as history.
Federation starships of the 23rd century could include historians among their officers. Lieutenant Marla McGivers, for instance, served as a historian aboard the USS Enterprise. When the Enterprise encountered the 20th century sleeper ship SS Botany Bay, Captain Kirk commented that this was a chance to "finally get some use out of that historian." (TOS: "Space Seed")