Let $T : V \to V$ be a linear transformation of the $F$-vector space $V$. Then using the (abstract) determinant function $\det : \operatorname{Hom}(V, V) \to K$ we can define a function $$ \lambda \mapsto \det(\lambda \cdot \operatorname{id} - T) $$ from $F$ to $F$. Now if we represent $T$ by a matrix $A$ we then have $\det(\lambda \cdot \operatorname{id} - T) = \det(\lambda \cdot I - A)$ where on the RHS the determinant function is an expression in the entries of the matrix. Now if we change the basis, i.e. represent $T$ by a different matrix $B = S^{-1}AS$, then a simple calculation shows that $\det(\lambda \cdot I - B) = \det(S^{-1}(\lambda I - A)S) = \det(\lambda \cdot I - A)$ and hence the value of of the matrix expression does not depend on the basis.
But this is often used as a justification that the characteristic polynomial (i.e. the polynomial $\det(\lambda \cdot I - A)$) is independent of the of the choosen basis. But all I can derive from the above arguments is that the values of the determinant are the same, i.e. if $p(x) := \det(x\cdot I - A)$ and $q(x) := \det(x \cdot I - A)$, then $q(x) = p(x)$ for all $x \in F$ if $B = S^{-1}AS$. If $F$ is infinite, this gives that the polynomials are equal (i.e. have the same sequence of coefficients, and hence the coefficients represent also invariants of the transformation).
But the equality that for $p(x) = a_n x^n + \ldots + a_1 x + a_0$, $q(x) = b_m x^m + \ldots + b_1 x + b_0$ we have $$ p(x) = q(x) \quad \mbox{ iff } \quad m = n, ~ a_i = b_i, ~ i = 0,\ldots, n $$ does not need to hold in finite fields, for example $p(x) = x^2 + x$ and $q(x) = 0$ in $\mathbb Z/2\mathbb Z$.
So then, is the characteristic polynomial (as a formal polynomial, i.e. determined by its coefficients) still unique in the case of finite fields? And if not, do you know an example?
The characteristic polyonmial $p_A(x)$ of a matrix $A \in \operatorname{M}_n(F)$ is defined as $$ p_A(x) := \det(x I - A) \in F[x], $$ i.e. $p_A(x)$ is the determinant of the matrix $xI - A \in \operatorname{M}_n(F[x])$. (Instead of the commutative ring $F[x]$ one could also use the associated field $F(x)$.)
The argument you give still applies: If $B \in \operatorname{M}_n(F)$ is similar to $A$ over $F$, then they are also similar over $F[x]$, and therefore $xI - A$ and $xI - B$ are similar over $F[x]$. Since similar matrices have the same determinant, it follows that $$ p_A(x) = \det (xI - A) = \det (xI - B) = p_B(x). $$
Note that we are always working over the commutative ring $F[x]$ (or field $F(x)$), so we are only working with polynomials themselves, and not with their associated polynomial functions. So the above equality $p_A(x) = p_B(x)$ really is an equality of polynomials, and not just of their associated polynomial functions.
PS:
As was pointed out in the comments, this leads to the question how to deal with the expression $\det(x \operatorname{id}_V - T)$. There seem to be at least two ways:
Don’t use it
Don’t define the characteristic polynomial of $T$ as $\det(x \operatorname{id}_V - T)$. Instead proceed as follows:
This still give you everything you need without making sense of $\det(x\operatorname{id}_V - T)$. Note that for every scalar $\lambda \in K$ we still have that $$ p_T(\lambda) = p_A(\lambda) = \det(\lambda I - A) = \det(\lambda \operatorname{id}_V - T), $$ so we can still use the same expression $\det(\lambda \operatorname{id}_V - T)$ when plugging in a scalar $\lambda$ for $x$.
Note that this approach of defining the characteristic polynomial $p_T(x)$ only needs that similar matrices have the same characteristic polynomial, which is precisely what you were concerned about in your question.
Extension of scalars
You can also use extension of scalars, if you are familiar with it:
If $\mathcal{B} = (v_1, \dotsc, v_n)$ is any $F$-basis of $V$, with respect to which $T$ is given by the matrix $A \in \operatorname{M}_n(F)$, then $A$ will also be the matrix of $T_{F(x)}$ with respect to $\mathcal{B}$, when regarded as an $F(x)$-basis of $V_{F(x)}$. Then $x I - A$ will be the matrix of $x \operatorname{id}_{V_{F(x)}} - T_{F(x)}$ with respect to $\mathcal{B}$. (The expression $x \operatorname{id}_{V_{F(x)}} - T_{F(x)}$ makes sense because $V_{F(x)}$ is an $F(x)$-vector space.) With this one can define the characteristic polynomial $p_T(x)$ as $p_T(x) := \det(x \operatorname{id}_{V_{F(x)}} - T_{F(x)})$.