Simultaneous measurement of cosmology and intrinsic alignments using joint cosmic shear and galaxy number density correlations