A grant of more than £½m for a three-year Living Seas Wales project has been awarded to two wildlife trusts.