Turn on the oven to 375°F (190ºC).
Butter a large ceramic or glass dish.
If fresh, cook ⅔ cup heavy cream in salted boiling water until soft. If frozen, let the corn come to room temperature and drain excess water.
Melt 1 tablespoon unsalted butter and 2 tablespoons olive oil in a skillet, and add the corn and ⅓ cup chopped onion and let it soften a little over medium heat for a few minutes. Remove from the heat and reserve.
In a large bowl stir 3 eggs with ½ cup whole milk and ⅔ cup heavy cream. Don’t beat, just integrate well.
Sift 2 tablespoons all-purpose flour over the egg mixture and stir well with a wire whisk.
Add the corn mixture, 2 tablespoons chopped fresh basil, ⅛ teaspoon sugar, 1 ½ teaspoons salt and ⅛ teaspoon Black pepper . Mix well.
Add ½ cup of the shredded cheese and stir everything.
Place in the dish and sprinkle the remaining ¼ cup cheese on top.
Bake for about 40-45 minutes, until golden and puffed and almost firm inside. Don’t overbake or it will start to dry.