In most cases, you can go between Terminals A, C, D, and E (note, there is no terminal B) while staying in security. According to the airport map, only the "high E" gates (E30 - E33) require you to leave security. So with the exception of those few gates, so long as both flights are AA, then you should be fine.