If your spaghetti is not cooked, cook it first in salted water for a few minutes less than the package directions call for. Drain.
In a large bowl, place the two eggs, half of the grated pecorino or parmesan and the pesto and beat well. Add the spaghetti and mix. Season, but be aware that the cheese is quite salty, so don't overseason it.
Grease a large pie plate or a springform pan and dump the spaghetti mixture into the bottom. Spread the ricotta in a layer over top of the spaghetti layer. Set aside.
Brown the vegan ground beef in a large frying pan or a dutch oven over medium heat in a few tablespoons of oil.
Add the marinara sauce, stir well to combine, and allow to cook down for about 5 minutes. Taste and adjust the seasoning. Spread this on top of the ricotta layer in the pan.
Top with the cheeses.
Bake in a preheated 350 degree oven for about 30 minutes, or until the cheese is bubbly and golden. Remove from oven and slice into wedges to serve.