Sprinkle the aubergine slices with salt and let them drain for 1 hour in a colander set in the sink or over a bowl.
Meanwhile, heat the olive oil in a frying pan over medium heat. Cook and stir the tomatoes and basil leaves for 5 minutes, stirring well. Blend with a hand blender to make a tomato sauce. Season with salt and pepper.
Preheat the oven to 180 C / Gas 4. Rinse and dry the aubergine slices.
Pour a thin layer of the tomato sauce into a shallow ovenproof dish. Cover with a layer of aubergine slices, then some Parmesan cheese, some mozzarella and some of the beaten egg. Continue layering the ingredients, finishing with the aubergine and tomato sauce. Season with salt and pepper.
Bake in the preheated oven until bubbly, about 30 minutes.
Serve this as a vegetarian main with some garlic bread and a green salad. It also works as a side dish.