That definition just does not work.
A first attempt to fix it would be to say that locally, the tangent line and the curve only intersect once. Even then, by that definition, two intersecting lines would be tangent to each other.
A more intuitive, but not rigorous, definition would be to say that the line, $\tau$ is tangent to the function $f$ at the point $(a, f(a))$ if
- $\tau(a) = f(a)$
- The more you zoom in on the point $(a, f(a))$ the better the line $y = \tau(x)$ approximates the curve $y = f(x)$.
The major idea is that the tangent line, $y = \tau(x)$ is, locally, the best linear approximation to the curve $y = f(x)$ at the point $a$. There is, in fact, a formal definition of derivative in more complicated spaces,
the total derivative
, which says exaclty that.
In undergrad calculus, the definition $f'(a) = \lim_{x \to a} \dfrac{f(x) - f(a)}{x-a}$ does produce that theorem $f(a + h) = f(a) + hf'(a) + O(h^2)$ which can be interpreted as saying that the line $\tau(x) = f(a) + (x-a)f'(a)$ satisfies conditions $(1.)$ and $(2.)$ stated above.