This is a mistake in Hodges. As you say, for any $n>0$, it's possible to construct a structure $B_n=$, where $f$ is a binary function symbol, such that every $n$ elements of $B_n$ generate a finite substructure but there are $n+1$ elements of $B_n$ which generate an infinite substructure. For example, you can take $U={\mathbb Z_{\ge 0}}$ and $f(a,b)=a+1,\ \ \ \ \ \hbox{if $b \equiv a+1 \ \ ({\rm mod}\ n+1)$},$ $f(a,b)=a, \ \ \ \ \hbox{otherwise.}$ $f$ has been defined so that it can generate no more elements than the unary successor function ($S(x)=x+1$), but it may generate fewer, as in order to generate an element which equals $S(a)$, the residue class of $S(a)$ modulo $n+1$ must already be occupied. Now, the elements $\{0,1,2,\ldots,n\}$ generate all of $U$ under $S$ and occupy all residue classes modulo $n+1$, so they generate all of $U$ under $f$. However, any $n$-element set $V$ must omit some residue class modulo $n+1$. Then, starting with some $a\in V$ as the first argument of $f$, we can only generate some proper subset of $T_a:=\{a, S(a), S^2(a), \ldots, S^n(a)\},$ since before we can generate all of $T_a$, we will come to the unfilled residue class, which cannot be filled using $f$. Therefore, any $n$-element set $V$ can generate only a finite substructure of $B_n$.
Now, taking the language $L$ to be $\{f\}$, if there were a quantifier-free type $T({\bf x})$ such that an $L$-structure $A$ was locally finite iff it omitted $T({\bf x})$, $T({\bf x})$ would have to be an $m$-type for some $m$. Then since $B_m$ is not locally finite, it must realize $T({\bf x})$, i.e., there are elements $a_1$, $\ldots$, $a_m$ in $B_m$ such that $B_m \vDash T(a_1,\ldots,a_m)$. But since $T({\bf x})$ is quantifier-free, then we also have $C \vDash T(a_1,\ldots,a_m)$, where $C$ is the finite substructure of $B_m$ generated by $\{a_1,\ldots,a_m\}$. Therefore, $C$ realizes $T({\bf x})$. Since $C$ is finite, it is locally finite, so this is a contradiction. Therefore, the statement cannot be proved.
In A shorter model theory, the exercise reads:
Let $L$ be a first-order language. An $L$-structure $A$ is said to be locally finite if every finitely generated substructure of $A$ is finite. (a) Show that there is a set $\Omega$ of quantifier-free types (i.e. types consisting of quantifier-free formulas) such that for every $L$-structure $A$, $A$ is locally finite if and only if $A$ omits every type in $\Omega$. (b) Show that if $L$ has finite signature, then we can choose the set $\Omega$ in (a) to consist of a single type.
To fix it, change the last sentence to:
(b) Show that if $L$ has finite signature, then we can choose the set $\Omega$ in (a) to consist of a single $n$-type for each $n$.
The exercise should then be doable.