These tutorials cover how the cortical source locations (source spaces) and forward models (AKA leadfield matrices) are defined.
Source alignment and coordinate frames
Using an automated approach to coregistration
Head model and forward computation
EEG forward operator with a template MRI
How MNE uses FreeSurfer’s outputs