How to lock center vertices with mirror modifier?
You want to enable clipping in the mirror modifier.
From the blender manual page for the mirror modifier.


Clipping
Prevents vertices from crossing through the mirror plane(s). Note that this is only valid in Edit mode (i.e when using object transformations, translations, scaling, et cetera, in Object mode, vertices will happily cross these borders.)
If Clipping is selected but vertices are outside of the Merge Limit the vertices will not merge. As soon as the vertices are within Merge Limit they are clipped together and cannot be moved beyond the mirror plane. If several vertices are selected and are at different distances from the mirror plane, they will one by one be clipped at the mirror plane.