The ahamkara (ego sense, it's me) ,
is a component of antahkarana ( chitta+budhi+manas+ahamkara) superimposed by consciousness principle(Kshetrajna) ,
causes the sense of doership and enjoyership. ..
The experience of identity sense , it's me is due to the manifestation of this component.
Transmigrating Soul is also a Shariira = (sukshma together with karana shariira) in Hinduism
Shiiryate iti Shariira (that which is perishable).. Sharira traya is ever changing..Gross body undergoes several vikaras(changes) say from a child to old man etc. yet ahamkara(it's me) does not fail for the lack of an id..It is not about any association with unique Id , (like a primary key or SSN) imagined to be vested with the ever-changing Shariira traya.
Sukshma perishes upon pralaya/realisation, Karana Shariira perishes only upon self realisation
All Shariiras are Jada(inert) , thus it includes ahamkara also ( like how a computer is inert without electricity). There is only One Kshetrajna (consciousness principle) that operates all the shariiras. As how a person who sees through microscope would not identify him/her self with the microscope, .. a wise would not l identity h-self with inert the body/soul but with that One Consciousness principle, the Kshetrajna one who actually sees , or is the real doer.So there is truly just One Id.
PS : A Yogi may be able to identify with another soul by the principle of samyama, the basis of how etc., could be referred from Patanjali yoga sutras .
Panchadasi.1.23 and 1.24.The five organs of sense, the five organs of action, the five praaNas, mind and intellect, these seventeen together form the subtle body. In some of the Upanishads ahamkaara and chittam are also counted separately, and the number of constituents is stated as nineteen,( Sri SN Saastri )
Being the reason for transmigration, it is called karana shariira , contains the unmanifest(latent) vasanaas(impression s) is the part of the soul together with sukshma Shariira
DNA of no two species are known to be same.. yet , some portion of it could be similar, owing to common ancestory.but one can't demand there should be unique id imbued in fingerprint or DNA , without which an identification is impossible ( the complex structure of DNA or fingerprint itself attributes to its unique Ness).. Likewise No two causal/subtle bodies could be the same (say like DNA).
(Although they evolve through samskaras ,capable of change, ie nonfixed unlike a finger print)
A Yogi knows it by the samyama by concentration(dhyana/dharana/samadhi) upon that object. Sadhak Sanjeevani Gita 4.5 , commentary says , Yukta Yogi knows past present future of all the species , whereas Yunjana yogi knows about His own past and future ... To my knowledge there is no mention of an ID for soul in scriptures.