Both are correct. However, there is a subtle difference in meaning and usage. "On" suggests that the emphasis is on the specific subject. "In" makes the emphasis on the person who has expertise.
Both are correct. You can say "be an expert in" or "be an expert on". However, when choosing between the two prepositions, there is a subtle difference in meaning and usage to consider. While "on" suggests that the emphasis is on the specific subject or area of expertise, "in" makes the emphasis on the person who has expertise.
My wife is an expert in cosmology.
We need an expert on artificial intelligence.
Which is the most common? The word expert is slightly more frequently used with "in", but both prepositions are quite common.
Alternatively, you can use the preposition "at" and say, for example, "be an expert at". In this context, "at" normally implies that someone is skilled at doing something.
My sister is an expert at playing chess.