Hello,
'Registration by invitation' only setting is used to set and then read an idFriend cookie during the registration step, but this information is not stored in the database anywhere to my knowledge.
However it is not difficult to write a module that will store the link between both users after the 2nd one completes the registration and joins the site; as a matter of fact I have recently implemented a custom module, that was responsible for track similar 'referrals' in a pyramid-like fashion, and then making use of these relationships (stored in extra table) in order to credit the referrers by displaying Google Ads with their AdSense ID codes.
Just storing the link is way easier and if you need this, I could develop such a module for you. Please send me a message if you're interested (or anyone else who thinks this very functionality could be useful).
best regards
Mark