WALL-E: World Alignment by Rule Learning Improves World Model-based LLM Agents