The Federal Trade Commission has put forth a law regarding this issue. The law is a Federal Consumer Law, and goes under US Code 15, Commerce and Trade, Chapter 50, Sections 2301 to 2312. This law is also known as the Magnusen-Moss Warranty Federal Trade Commission Improvement Act.
The Magnusen-Moss law states that the warranty CANNOT BE VOIDED out of hand, just for the DISCOVERY of the modifications. The modifications must be PROVEN to have had a DIRECT effect on a FAILURE of a system covered under the Warranty.
In other words, you should make sure that the modifications that you do to your warrantied Mazda have be exhaustively tested before being released, and that they have had no history of causing direct problems to the systems that they modify. If the dealer can prove that the modification of, say, your intake caused you to suck up water into your engine, you are out of warranty. But they have to PROVE a DIRECT correlation, not just void the whole warranty based on discovering a new intake installed.