It's based mostly on how many stages you clear before you reborn, plus a small bonus based on how many levels you've bought for your characters, plus certain moetifacts and moetans give percentage bonuses to crystal amounts. The biggest factor by far is how many levels you clear between reborns, as it's an exponential increase - doing a reborn at level 1000 gives a lot more than ten times as many crystals as reborning at level 100.