You cannot use the AIC to compare these. The AIC is calculated as:
$$
{\rm AIC} = - 2\log(L) + 2k
$$
where $L$ is the likelihood associated with the model, and $k$ is the number of parameters in the model. If you calculate the AIC for multiple models, you would choose the model with the lowest AIC value.
It is important to note that using this formula makes certain assumptions. For example, it assumes that every parameter added to the model contributes an equivalent amount of flexibility to the model's ability to fit the data. Since the models you are discussing have the same number of parameters (in fact the exact same parameters, I gather), this part of the formula drops out. Thus, you are simply comparing the likelihoods of the two models. Since these are on different scales, they are not comparable.
Consider this quick demonstration, coded in R:
set.seed(5403) # this makes the example exactly reproducible
x = rnorm(100, mean=150, sd=17) # the true data generating process
y = 92 + .5*x + rnorm(100, mean=0, sd=1)
lx = log(x) # taking logs
ly = log(y)
m = lm(y~x)
llm = lm(ly~lx)
AIC(m) # [1] 287.3273 # this is the right model
AIC(llm) # [1] -726.0908 # this is the model with the lowest AIC