Would the freedom of movement directive automatically cease to apply to the UK after a hard Brexit or is some sort of parliamentary action necessary for that?
The current law is that it would cease to apply at 11 PM GMT on March 29th 2019. The plan was to pass further legislation that transposed all EU rules, including freedom of movement, into British law before then, but in the event of a no-deal crash that probably wouldn't happen.
However, the British government has indicated that it would want to keep some aspects of freedom of movement, particularly good goods, and to an extent for services, capital and people. The extent of this is unclear at this time, but for example it does not wish to see any border infrastructure in Ireland and people who cross the border for work may be able to continue to do so. This would all require parliamentary action to implement.