One specific form of such shapings is a "taper" - such as the well known Morse tapers.
I don't know of a term for the general feature you're looking for, but tapers are adopted for many instances of it, probably because of their self-aligning nature. Consider the consequence of a machining error in the ID or OD of your diagram above - it will result in either imprecise alignment or no fit at all.
A similar error on a taper would translate to perfect centring with a slight displacement in the axial direction.
Morse tapers for example not only provide centring but can also provide drive force. Morse tapers are self-locking due to their shallow angle, combined with material properties such as friction and elasticity.
There are other tapers which are self-releasing (I believe the R8 tapers used in industrial tooling would come into this category) - they require some other means to hold the parts together - often a collet closer.
Indeed, many systems of collets use tapers to guarantee high accuracy in centring (low runout).
Fitting a backplate to a lathe chuck is precisely this operation without a taper, and I see this instruction page uses the term "spigot" for the male part, but the female part (in the rear of the chuck) is simply called a "recess".