May a citizen of the United States be punished for an action that was not contrary to any law at the time of the action, but does violate a law that was enacted after the time of the action?
No. A law that attempts to punish actions that were done before the law was made, is called an "ex-post-facto law." This also is expressly forbidden by the Constitution.