Transverse mode analysis of a laser beam by near and far field intensity measurements