You get them while digging in the Underground....
Trainer ID last digit even : Armor Fossil (Shieldon)
Trainer ID last digit odd : Skull Fossil(Cranidos)
P.S. The order reverses after obtaining the National Dex
P.P.S You can go underground once you've obtained the explorer kit from Eterna City
Hope This Helps :)