St Johnstone advanced to the semi-finals of the Premier Sports Cup after a comfortable 2-0 win over Dundee at Dens Park.