I also have a friend that has stop lights mounted to his boats transom, but they get plugged into his boat trailer. He was tired of always changing the lights on his trailer from them always being dunked in to salt water, so he mounted them to the top of the transom. he did mount them so they are easily removable.
There is a company marketing boats that are trailerable and instead of lights on the trailer, there are stern lights that only work when the boat is on the trailer and they do the braking, turning ect. At first I thought it was an interesting cheap way to add lights, then I thought, wouldn't the trailer be illegal without signal lights.