For calculating the AIC for factor models, I calculate the likelihood based on the multivariate distribution of the factor model. I try to make any assumptions as explicit as possible. Bayesians typically do not use the (so-called) BIC. WAIC (Watanabe-Akaike Information Criteria) is becoming more common among Bayesians.
When thinking about the AIC, you should try to clarify what you are using it for. More often than not it is optimization or risk management. I'm more familiar with optimization, so I'll try to keep my observations constrained to that area. For the sake of simplicity, I'll assume a multivariate normal here, but this can easily be relaxed.
Either a time series or cross-sectional model can be thought of as a multivariate distribution. For instance, in the time series approach, you would just make some explicit assumption about the correlations between stocks. In a rolling cross-sectional approach, you can use the mean and covariance of the coefficient/factor returns and then get a conditional multivariate distribution (i.e. it changes each period depending on the factor exposures).
There are two clear ways to construct the multivariate distribution (regardless of time series or cross-sectional). Either using the mean and covariance of the factors to get the mean and covariance of the stocks in the universe. Alternately, you treat the factors as exogenous and don't bother with the mean and covariance of the factors (at the model evaluation stage).
You will get different log likelihoods in each case. I prefer the first approach for a few reasons. The first is that it is more sensible to compare against a base case of a multivariate normal. Second, it is more consistent with what is important for portfolio optimization (the mean and covariance of each stock). Third, using market returns will necessarily make your error smaller and make your model look better (when it may not actually be). Fourth, factor returns are often not exogenous. We still have to forecast them for portfolio optimization. Finally, I get really confused about what is an isn't a parameter for AIC (market weighted returns are the mean of a cross-sectional distribution, what really makes them different than the regression coefficients from a cross-sectional regression). I'd rather abstract away from it and focus on the mean and covariance of the factors, which I can be pretty confident are parameters that matter for AIC.
I'm not saying you can't take the other approach, nor can I recall any academic research that says not to do it one way versus the other. I might be more inclined to use the other approach when I can't write down the likelihood function (i.e. for more sophisticated models).
While AIC can be useful in factor modelling, such as answering questions like should I use a market weighted factor or an equal weighted factor, I don't put a heavy emphasis on it personally. It's definitely not what I start with. My typical approach begins with some baseline model and proceeds by evaluating (quantitatively or qualitatively) whether there are some features of the data that the model is not capturing.
Bayesians call this a posterior predictive check. The goal of posterior predictive checks is to evaluate in what ways your model does not fit the data. What is the model not capturing. To perform this check, simulate returns from the model and see if they produce patterns that match actual returns. Do the simulated mean, standard deviation, and correlations match what you would expect? How does a subset look (just focusing on country or sector or large/small or value/growth differences)?