First off, tracking US Navy aircraft carriers using AIS is a terrible idea, because of the seemingly-random and inconsistant US Navy AIS transponder policy. The policy made it's public debut recently as a result of two fatal collisions; that of the USS John McCain, and the USS Fitzgerald. The US Navy provided guidance to commanders to use AIS when travelling in proximity to civilian vessels. However, the safety of the Carrier Strike Group, and the carrier itself, is of paramount concern; so it seems the US Navy is a little reluctant to expose their location consistently across the fleet.
Some ships in the US Navy pop up on public unclassified AIS tracking sites like MarineTraffic.com routinely, while others haven't beaconed once for the past 5+ years. The aircraft carriers are a mixed bag; they aren't just using their AIS transponder to send a "message" to adversaries that they can operate anywhere they want in International waters, they're also broadcasting their location to foreign port facilities who send out pilot vessels and tugs to help their approach into harbour.
Another point about OPSEC; if a US Navy vessel activates their AIS transponder, the commanding officer made a judgement to do so, and expose their position to anyone with an internet connection who can pull up the MarineTraffic.com web page. These are not accidents, they are deliberate beacons for strategic messaging as well as local inter-operation with allied port facilities. Their position is neither secret, or dangerous. But don't take my word for it; it was the commanding officer who indicated as much when they turned on their transponder. If the ship's commander is perfectly alright with broadcasting their position to the world, you are allowed to know as well, guilt-free, without being a "spy"!
This is not a "loose lips sink ships" situation.