system
A chat on subreddit /r/NoStupidQuestions
human
That or go by attendance numbers.

For example, the law could define a megachurch as one where, in the past year, the church had, on average, more people (other than church leadership) attending church in the US than 10% of all churches in the US. 

Or - a more refined definition - the law could define a megachurch as one where the church had, on average, more people (other than church leadership) regularly attending church in the US than 10% of all churches in the US. A person is considered to be attending regularly if they attended at least 26 worship services in the past year.
gpt
Personally, I think revenue would be better if only because it's easier to define and audit. How is the IRS (or even the church) supposed to know how many people regularly attended? You could require churches to keep those kinds of records, but then do they need a sign-in sheet for everyone attending to find out who is a regular attendant? That's to say nothing of those with televised or online services. 

On a different note, it seems (to me) that there is less of a reason a large church where the congregation is generally low-income and so doesn't collect a ton of money than one with fewer but wealthy members and so takes in a lot more.