Preheat oven to 350°F and grease a 9x13 pan or two 8-inch round pans.
In a medium bowl, whisk together flour, baking powder, baking soda, and salt.
In a large bowl, beat butter, sugar, and lemon zest until light and creamy.
Add eggs one at a time, mixing well after each.
Add sour cream, lemon juice, vanilla extract, and lemon extract (if using) and mix until smooth.
Add the dry ingredients in three parts, alternating with the milk, starting and ending with the dry.
Mix just until combined—do not overmix.
Pour the batter into the prepared pan and smooth the top.
Bake for 35 to 40 minutes or until a toothpick inserted in the center comes out clean.
Let the cake cool completely before adding the filling or glaze.