Just like the EMS sharmningan evolves into the rinnegan or transmutes into the rinnegan when an indra incarnation takes an ashura incarnation's DNA/chakra/being, the byalugan became the tenseigan when put into an Ootsutsuki. By awakening the tenseigan the user becomes several times more powerful like a rinnegan user, however if intense damage is done to the eye before it fully matures or in general overall it will devolve back into a byakugan. So the process to get a tenseigan is rather simple and the results are impressive but the drawbacks are abysmal. The rinnegan is tedious but the results are,lasting and impressive. Think of it this way the rinnegan is an algorithm and the tenseigaan is more of a heuristic. But that's basically how toneri got his tenseigan