You dont get hacked. Thats now how it works. You can get hacked Pokemon, you can get banned for using hacked Pokemon you got traded. Thats the worse they can do to you.
The connection breaking was probably due to an internet error on your side, or maybe the fact that the "hacked" shiny reshiram was hacked, hence causing the hack detection to prevent it from being traded.