Preheat oven to 350 degrees. Grease a 9 by 12 (or similar) baking dish.
In a large mixing bowl, combine the melted butter, Parmesan cheese, and egg yolks, whisk well.
Bring a large pot of salted water to a boil. Cook the spaghetti according to the package directions. Drain the spaghetti and toss with the cheese/egg yolk mixture. Set aside.
In a large skillet over medium-high heat, cook the beef and onions, stirring occasionally, until the onions are soft and the beef is no longer pink, 5-6 minutes. Add the garlic and cook, stirring, for another 30 seconds. Add the pasta sauce and cook, stirring occasionally for five minutes.
Layer half the spaghetti evenly in the prepared baking dish. Top with half the cottage cheese, half the sauce, and half the mozzarella cheese. Repeat the layers.
Cover the dish with foil and bake for 40 minutes. Remove the foil and bake for another 20-25 minutes or until the cheese is deeply golden brown. Let sit for 10-15 minutes before serving. Garnish with fresh basil.