And in particular this goes for H2020 projects.
This happened to a colleague of mine for FP7, I assume H2020 will be pretty much the same. Essentially, you have two options:
(1) Find a proxy to formally finish the project on your behalf. That is, find somebody at your current institution with a high enough status that he is allowed to take over the project without much administrative quabbles (e.g., a senior professor), and formally hand over the project to him when you leave. You will of course still do the actual work - the handover is just a formality. Of course this requires a significant amount of trust and goodwill (on both sides), so you better be good friends with the person that proxies for you. As long as you both are at the same institution, the administrative effort of this solution is not too high.
(2) Officially transfer the project to your new institution. This requires an amendment of your DOW (description of work), and the sanctus of your new institution, all partners of the project, and the european commission (i.e., of the PO and the responsible lawyers on EC side). This will take long - expect the entire process to take possibly a year or so. Additionally, there is a chance that some negotiations between you, your old institution, and your new institution are required (e.g., to answer the question to what percentage the overheads should be transferred to the new institution). H2020 proposals are good money for universities, and you should not expect your old institution to let go of such a project easily.
Edit: Clearly, option 2 is only available if your new institution is also eligible for H2020 funding.