Cross eyed ?

My 2 year old goes cross eyed maybe 2-3 times per day. It used to be a few times a month but now is getting a bit worse so I’m getting concerned. Is this something I go to his pediatrician about, or directly to an eye dr? I was told by family this is an indication that he’ll need glasses (everyone in our family has them)