Wash and peel the aubergines, then cut them into slices that are not too thin. Place them in a colander, sprinkle with salt and cover with a weight to help the water drain out. Drain the aubergine slices, squeeze them well and fry them in hot olive oil.
In a saucepan, fry the chopped garlic in a little oil and, as soon as it is golden brown, remove it and pour in the tomato purée; reduce, remove from the heat, season with chopped basil and a pinch of salt. Arrange the aubergines in the bottom of an oiled oven dish, cover with 1 ladleful of tomato sauce, sprinkle with grated Parmesan cheese and cover with thin slices of mozzarella.
Repeat this process, alternating layers of aubergine, sauce, Parmesan and mozzarella until all the ingredients are used up. The last layer should be tomato sauce. Drizzle with a little oil and bake in the oven at 200°C for about 40 minutes. Serve the aubergine parmigiana piping hot.