Write a script to monitor GPU utilization and trigger an alert if memory usage exceeds a specific threshold.
Implement monitor_gpu(readings, memory_threshold) for chronological GPU readings. Each reading is a dictionary containing gpu_id, utilization, and memory_used; return alert dictionaries only when a GPU changes from at or below the threshold to above it. A GPU that remains above the threshold should not generate repeated alerts until its memory falls back to or below the threshold.
def monitor_gpu(readings, memory_threshold):