The metric dimension of the lexicographic product of graphs