A New Method to Separate Star-forming from AGN Galaxies at Intermediate Redshift: The Submillijansky Radio Population in the VLA-COSMOS Survey