IF mature and alone....chances are it's a Boar.
With respect to identifying by physical features....this can be tricky depending upon distance, lighting and angle of the animal observed.
But generally speaking, look first for the presence of testicles (large even on juveniles) and along the belly line for a 'penile sheath'.
If neither of these areas are visible you can sometimes make out the 'lip curl' (upper) on boars which if mature....will have more distinct Cutters and Whetters.
On hogs not yet mature some (or none) of the above might prove any help. And even on mature animals....physical size and shape isn't always a good indicator.
I have killed Sows approaching 300 lbs in weight (weighed on a scale) that had a build not much different than boars.
IF time and circumstance permit....use a good set of binoculars to get a good look at the animal if the sex of it is important to you. Personally, I kill them all....as many as possible, as often as possible. They are a scourge.
Sow lacking male 'parts':
Look for lip curl:
Sometimes cutters and whetters of boar are obvious:
Don't let body size or shape fool you, this is a big sow: