Check local codes BUT When I have to do this type of installation I use a closed tank properly vented AND I only use a SEWERAGE Ejector not a cheap sump pump as they can get the impeller clogged with buttons and soap scum.
http://www.zoeller.com/zcopump/products/homeimprove/drainpump.htm Go to this address and see a product that is made just for what you need. It is BOCA and UPC approved. It has a 1/2″ solids handling pump in it. The pump in a wash machine will not put somthing that big through to this pump/tank system. The stainer on this pump will handle any thing the wash machine will diliver to it. A 2″ pumop would be a little over kill. This pump and tank system needs to be vented so that it will work correctly.