In Transformers, after Autobots reveal themselves to Mikaela and Sam, Optimus tells them about how Cybertron got destroyed by Megatron and Decepticons. Then he proceeds to tell them how Sam's great-great-grandfather found Megatron in the North Pole pretty detailed like how it was an accident and how by mistake, he activated Megatron's navigation system.
How can he know all that? Even if it is somehow written in the Sector 7's top secret files (which is unlikely), Autobots never accessed to the P.O.T.U.S. or any other military/government network by that point.