This phenomenon is called metathesis. I humbly direct you to my answer to a related question for details. Here, I will just note that aks goes back to Old English, where there were two versions of the verb, ascian and acsian. See this Language Log post:
As the [Oxford English Dictionary] explains, the verb form spelled "ax", and meaning "To call upon any one for information, or an answer", originated more than a thousand years ago in OE. ("Old English")[.]
[...]
The crucial bit [is] this:
Acsian, axian, survived in ax, down to nearly 1600 the regular literary form, and still used everywhere in midl. and south. dialects, though supplanted in standard English by ask, originally the northern form.
So, as a matter of fact, aks is not a speech error. It is a well-established feature of certain dialects.