I'm not certain how it works with Alamo and what, if anything, Costco pays but I think it's more likely to be a promotion offered by Alamo. Marketing thru large travel sites.
The Costco contract ID is posted on every one of these monthly car rental discount threads. No membership number required. One can use it directly on the Alamo site although I've noticed the pricing is a bit different compared to directly with the Costco site in the past year or two. It used to be identical. But on the Alamo website you can then use it conjunction with a coupon which usually gets the cost lower than directly thru the Costco travel site.