The definition is not correct.
A canonical transformation is defined by requiring that the Poisson bracket are preserved.
Then it follows that the Hamiltonian form of the equation of motion is preserved as well with a new Hamiltonian. The converse is generally false.
Consider, for a pair of reals such that $a\cdot b\neq 0$,
$P:=ap$, $Q:=bq$ and $K(Q,P):=abH(q,p)$.
In this case the Hamiltonian form of the equation of motion is preserved, but
$\{Q,P\} = ab \{q,p\}= ab$ instead of $1$.
ADDENDUM.
Let us consider the spacetime of phases $\mathbb{R} \times F$, where $F$ is the space of phases and $\mathbb{R}$ the temporal axis (a better description would use a fiber bundle).
Definition.
A bijective and bi-differentiable coordinate transform between two local charts $$T= t+c\:,\quad Q=Q(t,q,p)\:, \quad P=P(t,q,p)$$ on $\mathbb{R}\times F$ (where from now on $t$ and $T$ are always the natural coordinate on the temporal axis $\mathbb{R}$ up to an additive constant)
is said to be canonical, if it preserves the Poisson brackets:
$$\{f,g\}_{t, q,p} = \{f,g\}_{T,Q,P} $$
for every choice of smooth functions $f$ and $g$.
A canonical transformation is completely canonical if it has the form
$$T= t+c\:,\quad Q=Q(q,p)\:, \quad P=P(q,p)\:.$$
$\diamondsuit$
N.B: The above preservation of Poisson bracket is equivalent to requiring that
$$\{Q^k,Q^h\}_{t,q,p}= \{P_k,P_h\}_{t,q,p}=0\:,\quad \{Q^k,P_h\}_{t,q,p}= \delta^k_h\:.$$
We have the following result.
Proposition 1 [Preservation of Hamilton equations].
Let a bijective and bi-differentiable coordinate transform
$$T= t+c\:,\quad Q=Q(t,q,p)\:, \quad P=P(t,q,p)$$
between two local charts on $\mathbb{R}\times F$
be canonical and suppose that the domain of the former coordinate system has the form
$I\times G$, where $I$ is an open interval and $G\subset F$ is an open connected and simply connected set.
If $H=H(t,q,p)$ is a (smooth) Hamilton function, then there is a second Hamilton function $K=K(T,Q,P)$ such that the solutions of the Hamilton equations referred to $H$, translated into the new coordinates, are solutions of the Hamilton equations referred to $K$ and vice versa.
$K$ is determined by $H$ up to an additive arbitrary function of $T$.
If the coordinate transformation is completely canonical, then it is always possible to choose $K(T,Q,P)=H(t,q,p)$.
$\blacksquare$
Remark. The preservation of Hamiltonian form of the equation of motion does not imply that the transformation of coordinate is canonical as I illustrated with the example above.
There are equivalent definitions of canonical transformations.
Proposition 2 [Equivalent conditions to canonicity].
Consider a bijective and bi-differentiable coordinate transform
$$T= t+c\:,\quad Q=Q(t,q,p)\:, \quad P=P(t,q,p)$$
between two local charts on $\mathbb{R}\times F$
Suppose that the domain of the former chart has the form $I\times G$, where $I$ is an open interval and $G\subset F$ is an open connected and simply connected set.
The following facts are equivalent
The transformation of coordinates is canonical.
$\sum_{k=1}^n dp_k \wedge dq^k = \sum_{k=1}^n dP_k \wedge dQ^k$.
For every function $H=H(t,q,p)$ there is a function $K=K(T,Q,P)$ such that
$$\sum_{k=1}^n p_kdq^k - H dt = \sum_{k=1}^n P_kdQ^k - K dT + df$$
for some smooth function $f$.
The Jacobian matrix $\frac{\partial (P,Q)}{\partial (p,q)}$ belongs to $Sp(n,\mathbb{R})$ everywhere.
$\blacksquare$
Remarks
$\sum_{k=1}^n dp_k \wedge dq^k$ is said symplectic form on $F$.
$\sum_{k=1}^n p_kdq^k - H dt$ is called Poincaré-Cartan 1-form, and the confition 3 above is namebd Lie's condition.