Beryl weakens to a tropical storm as it continues through Texas