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")
Berlinghoff Rasmussen lied in 2368, saying every historian from his "time" knew the bridge of USS Enterprise-D. Jean-Luc Picard doubted that the layout of his ready room could possibly be of interest to them. (TNG: "A Matter of Time")
While time travelling back to 2268, Julian Bashir expressed confusion over Miles O'Brien wearing a red uniform, prompting the engineer to ask if he knew anything about that time period. Bashir responded with, "I'm a doctor, not a historian." (DS9: "Trials and Tribble-ations")