First you define the system with a Lagrangian (function of generalized coordinates, their time derivatives and time). From that Lagrangian you form the Hamiltonian (function of generalized coordinates, momenta and time). Those generalized coordinates and momenta are canonical cause the Hamilton equations of motion look in the 'canonical way':
Now later you may decide to change the generalized coordinates, momenta and even time to other coordinates: (q, p, t) -> (Q, P, T). A change of the variables in general changes the form of the differential equations of motion. The new variables are called canonical if then new equations of motion have the same 'canonical' form albeit with different effective Hamiltonian K:
You can test if a coordinate transformation of (q, p, t) will be canonical by using Poisson brackets.