Endogenous Transaction Costs and Division of Labour