The tangent space to an affine variety has a "local formulation". I am studying the chapter 10 (Smooth Varieties) in Gathmann's lecture notes on Algebraic Geometry and there are several things that I don't understand. Let me recall the context.
He defined the tangent space as follows.

Definition 10.1 Let $a$ be a point on a variety $X$. By choosing an affine neighborhood of $a$ we assume that $X \subset \mathbb A^n$ and that $a = 0$ is the origin, so that no polynomial $f \in I(X)$ has constant term. Then
$$T_aX = V(f_1:f \in I(X)) \subset \mathbb A^n$$
is called the tangent space of $X$ at $a$, where $f \in K[x_1, \ldots, x_n]$ denotes the linear term of a polynomial $f \in K[x_1, \ldots, x_n]$.

He said as a remark that in this definition we made a choice of the affine variety $X$ such that $a = 0$ and in fact this definition does not depend on this choice. To show this statement, he proves the following lemmas.

Lemma 10.4 Let $X \subset \mathbb A^n$ be an affine variety containing the origin $a = 0$, whose ideal is then $I(a) = \langle\overline{x_1}, \ldots, \overline{x_n} \rangle\trianglelefteq A(X)$ (the coordinate ring). Then there is a natural vector space isomorphism
$$I(a)/I(a)^2 \cong \text{Hom}_K(T_aX, K).$$
In other words, the tangent space $T_a X$ is naturally the vector space dual to $I(a)/I(a)^2.$

And then

Corollary 10.5 For $S = A(X)\backslash I(X)$, we have
$$I(a)/I(a)^2 \cong (S^{-1} I(a))/(S^{-1}I(a))^2.$$
In particular, if $a \in X$ is a point on any variety $X$ and $I_a~(\cong S^{-1} I(a))$ is the unique maximal ideal in $\mathcal O_{X, a}$ (which is the stalk at $a$ of $\mathcal O_X$ isomorphic to $S^{-1}A(X)$), then $T_aX$ is naturally isomorphic to the vector space dual to $I_a/I_a^2$ and thus independent of any choice.

First, for $a \in X$ we can always suppose that $X$ is an affine variety by definition of a variety but why can we suppose that $a = 0$? Then I am not very sure to understand the explanation why $T_aX$ has a "local formulation". Why the corollary 10.5 does only depends on $a$ and on nothing else? I am not very comfortable with this explanation so if one of you could talk a bit more about that it would be very nice!
 A: Question: "First, for a∈X we can always suppose that X is an affine variety by definition of a variety but why can we suppose that a=0? Then I am not very sure to understand the explanation why TaX has a "local formulation". Why the corollary 10.5 does only depends on a and on nothing else? I am not very comfortable with this explanation so if one of you could talk a bit more about that it would be very nice!"
Answer: To fully understand your question, you must include some definitions. Different authors use different definitions.
If $k$ is an algebraically closed field and if $a:=k[x_1,..,x_n]$ is the polynomial ring in $n$ variables with $I\subseteq A$ an ideal, let $X:=V(I)$ be defined as follows:
$$V(I):=\{a\in k^n:f(a)=0\text{ for all }f\in I\}.$$
If $a:=(a_1,..,a_n)\in X$ there is an automorphism $\phi_a$ of $\mathbb{A}^n_k$ defined as follows:
$$\phi_a(x_i):=x_i-a_i.$$
Let $\mathfrak{m}_a:=(x_i-a_i)$ be the maximal ideal corresponding to $a$.
It follows $\phi^{-1}(\mathfrak{m}_a)=(x_1,..,x_n):=\mathfrak{m}_0$. The automorphism
$$\phi_a: \mathbb{A}^n_k \rightarrow \mathbb{A}^n_k$$
maps $a:=(a_1,..,a_n)$ to the origin $0:=(0,..,0)$. When we restrict $\phi_a$ to $X$ we get an induced isomorphism
$$\phi_a: X \rightarrow \phi_a(X):=Y$$
mapping $a$ to the origin $0$. The tangent space is intrinsic hence is unchanged under isomorphisms. Hence we may study the tangent space of $Y$ at the origin $0$.
Remark: You should include more details where you take care about the notation since it seems your notation is not correct. What you must specify is the following: In the language of Hartshorne, Chapter I, if $X \subseteq k^n$ is an algebraic variety, there is a prime ideal $I(X) \subseteq k[x_1,..,x_n]$ where $I(X)$ is the ideal of functions vanishing at $X$. We define the coordinate ring $A(X)$ of $X$ as follows: $A(X):=k[x_1,..,x_n]/I(X)$. When you write $S:=A(X)-I(X)$ with this definition it follows $I(X)=(0)$ is the zero ideal hence $S$ is the set of all non-zero elements in $A(X)$. Then you choose a "point" $a\in X$ with ideal $I_a$ and localize at $S$ and claim there is an isomorphism
$$ I_a \cong S^{-1}I_a.$$
What you are doing here seems to be to pass to the quotient field $K(X):=A(X)_{(0)}$.  And there are no non-trivial ideals in $K(X)$ since $K(X)$ is a field, hence $S^{-1}I_a=(1)=K(X)$.
What you must do is to explain this construction more closely. It is not clear what you are speaking about.
PS: If you look at Hartshorne, Exercise I.7.4 there is an elementary exercise where you speak of the tangent line and the dual curve of a plane projective curve. This exercise is instructive. There is also an intuitive explanation in Mumfords "the red book...".
As mentioned in the comments: The tangent space and cotangent space depends only on the local ring $\mathcal{O}_{X,x}$ of $X$ at $x$ and is invariant under isomorphism. Under the automorphism $\phi_a$ above we get an induced isomorphism of local rings
$$ \mathcal{O}_{X,a} \cong \mathcal{O}_{Y,0}$$
where $0\in Y$ is the origin. This induce an isomorphism of vector spaces
$$T_aX \cong T_0Y.$$
In general if $i:U \rightarrow X$ is an open subvariety with $x\in U$ is follows
$$\mathcal{O}_{X,x}\cong \mathcal{O}_{U,x}$$
is an isomorphism of local rings, hence you may always choose an affine open subvariety $U:=Spec(B)$ containing $x$ when making calculations.
Example - affine schemes: If you are familiar with affine schemes this example may be an explanation of Corr 10.5: If $X:=Spec(B)$ and if $\mathfrak{p}\subseteq B$ is a prime ideal and $f\in B$ with $f\notin \mathfrak{p}$. Let $x\in X$ be the point corresponding to the prime ideal $\mathfrak{p}$. There is an isomorphism of local rings
$$L1.\text{  } (B_f)_{\mathfrak{p}} \cong B_{\mathfrak{p}}.$$
Let $U:=D(f):=Spec(B_f)$. At the level of local rings you get from $L1$ an isomorphism of local rings
$$ \mathcal{O}_{X,x} \cong \mathcal{O}_{U,x}$$
The ring $\mathcal{O}_{U,x}\cong B_{\mathfrak{p}}$ is a local ring with maximal ideal $\mathfrak{m}(x):=\mathfrak{p}B_{\mathfrak{p}}$ and you may define the tangent space $T_xX$ as follows:
$$T_xX:=Hom_{\kappa(x)}(\mathfrak{m}(x)/\mathfrak{m}(x)^2, \kappa(x)).$$
When $\mathfrak{p}$ is a maximal ideal it follows $\kappa(x)\cong k$. I believe there is an intuitive explanation of the geometric meaning of the tangent space at non-closed points in the reference I gave above.
This definition seems unintuitive and abstract to someone not familiar with this construction but it is the correct definition - again I believe "The red book.." gives a good intuitive explanation why this is the correct definition.
