Traits contain genetic information that can be inserted into eggs (Using the Splice Manipulator).Craft an empty trait container and carry it around with you.
Upon killing a mob it will be filled with a random trait collected from that mob. The trait container will have a nearly depleated damage bar and the tooltip witll say it requires more info. To fill it up you'll need to kill more mobs that contain that same trait while carrying that container with you. Once you've killed enough the damage bar will disapear and the trait will be ready for you to use!
Having trouble killing too many mobs? Can't find enough mobs to kill that have the trait you want? Have a bunch of energy surplus? Use the Trait Synthesiser and it will slowly fill your traits up for you!
If you don't like the randomness of the whole process and want to get an specific trait for an entity, you may use the Trait Collector to extract specific traits for an entity! And you won't even have to kill your precious friend! Traits collected with this will still require more data. Kill mobs or use the Trait Synthesiser to fill them up.