To make the polenta, line a large, rimmed baking tray (roughly 18 inches by 13 inches) with parchment. Heat oil in a large pot over medium heat and add rosemary. Sauté for a couple of minutes then add broth and salt. Bring to a simmer. Whisk in polenta and continue to cook, while stirring constantly. For instant polenta, cook for a couple of minutes, or until the polenta starts to pull away from the side of the pot. For regular polenta, follow package instructions. If the polenta starts to get too thick before it’s done, add water, 1/4 cup at a time, as necessary. When the polenta is done, empty onto the lined baking tray and spread evenly, it should be about 1/4-inch thick. You'll cut this in half and the halves will create the two layers in the lasagna. Set aside to cool.
To make the squash, preheat the oven to 425°F and line a baking tray with parchment. Peel and trim squash. Cut the squash at the base of the neck, where it meets the round bulb at the end. Reserve the end with the seeds for another use. Cut the long part of the squash in half lengthwise then cut each half crosswise into 1/4-inch-thick slices. Place the slices on the lined baking tray and drizzle with oil. Toss with your hands to evenly coat. Arrange slices in a single layer and sprinkle with salt. Roast until fork-tender, about 20 minutes. Remove from oven and set aside to cool. Reduce the oven temperature to 375°F.
Prepare to make the cashew filling. If you have a 14-cup food processor, place all the filling ingredients into the bowl of the processor at once. If your processor is smaller, do this in two batches. Pulse to combine, then process for about 1 1/2 minutes until creamy and smooth. Taste and adjust the flavor by adding more salt, lemon, or nutritional yeast.
To make the pesto, place walnuts and garlic in a food processor or blender. Pulse to finely chop. Add spinach, nutritional yeast, sage, lemon juice, and salt. Pulse until ingredients are finely chopped. With the processor on, drizzle in the olive oil and blend until smooth. Taste and adjust the flavor by adding more salt or lemon juice.
To assemble the lasagna, lightly oil a 9-inch by 13-inch casserole dish or baking pan. Cut the cooled polenta in half crosswise, giving you two pieces that are approximately 9 inches by 6 inches each. Using a spatula and your hands, carefully transfer one half into the casserole dish. Press to ensure it is flat and even. If it feels unwieldy, cut each polenta half in half again, and transfer the two smaller halves into the bottom of the casserole dish. Using a spatula, evenly spread half of the cashew filling over the polenta. Arrange roasted squash slices, slightly overlapping, over the filling. Spread about 2/3 of the pesto over squash. Repeat the layers once more with the remaining polenta, filling, and squash. Cover with foil and bake for about 20 minutes. Remove foil and bake for another 15 minutes. Remove dish from oven and drizzle remaining pesto on top. Cut into squares and serve.