The usual definition of metric dimension (and the one initially given abovein the OP) is the smallest cardinality of any metric basis. This generalizes the notion for metric dimension in graphs and is well-defined for any metric space (finite or not).
To see this let $(M,d)$ be a metric space and $\mathcal{G}$ be the collection of metric generating sets. There are two natural posets one can define on $\mathcal{G}$: let $P_1 = (\mathcal{G}, |\cdot|)$ be defined by $G \prec G'$ if $|G| < |G'|$ and let $P_2 = (\mathcal{G}, \subset)$ be defined by $G \prec G'$ if $G \subset G'$. Note that the minimal elements of $P_1$ are the metric bases $\mathcal{B}(M,d)$. Also notice that the metric bases are contained in the minimal elements of $P_2$ and that this containment is generally strict.